forked from cel-expr/cel-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunknown.cc
More file actions
32 lines (26 loc) · 719 Bytes
/
Copy pathunknown.cc
File metadata and controls
32 lines (26 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "common/unknown.h"
#include "common/macros.h"
namespace google {
namespace api {
namespace expr {
namespace common {
Unknown::Unknown(Id id) { ids_.insert(id); }
Unknown::Unknown(absl::Span<const Id> ids) {
assert(ids.begin() != ids.end());
ids_.insert(ids.begin(), ids.end());
}
std::size_t Unknown::hash_code() const {
std::size_t code = internal::kIntegralTypeOffset;
for (const auto& id : ids_) {
internal::AccumulateHashNoOrder(id, &code);
}
return code;
}
std::string Unknown::ToString() const {
internal::SequencePrinter<internal::SetJoinPolicy> printer;
return printer("Unknown", ids_);
}
} // namespace common
} // namespace expr
} // namespace api
} // namespace google