MCPcopy Create free account
hub / github.com/apache/fory / NestedChoice

Class NestedChoice

cpp/fory/serialization/namespace_macro_test.cc:108–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106};
107
108class NestedChoice final {
109public:
110 using Values = std::map<uint32_t, std::vector<uint64_t>>;
111
112 NestedChoice() = default;
113
114 static NestedChoice values(Values value) {
115 return NestedChoice(std::move(value));
116 }
117
118 uint32_t fory_case_id() const noexcept { return 1; }
119
120 template <class Visitor> decltype(auto) visit(Visitor &&vis) const {
121 return std::forward<Visitor>(vis)(values_);
122 }
123
124 bool operator==(const NestedChoice &other) const {
125 return values_ == other.values_;
126 }
127
128private:
129 Values values_;
130
131 explicit NestedChoice(Values value) : values_(std::move(value)) {}
132};
133
134class Partial final {
135public:

Callers 1

valuesMethod · 0.85

Calls

no outgoing calls

Tested by 1

valuesMethod · 0.68