MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Attribute

Class Attribute

base/attribute.h:178–214  ·  view source on GitHub ↗

Attribute represents resolved attribute path.

Source from the content-addressed store, hash-verified

176
177// Attribute represents resolved attribute path.
178class Attribute final {
179 public:
180 explicit Attribute(std::string variable_name)
181 : Attribute(std::move(variable_name), {}) {}
182
183 Attribute(std::string variable_name,
184 std::vector<AttributeQualifier> qualifier_path)
185 : impl_(std::make_shared<Impl>(std::move(variable_name),
186 std::move(qualifier_path))) {}
187
188 absl::string_view variable_name() const { return impl_->variable_name; }
189
190 bool has_variable_name() const { return !impl_->variable_name.empty(); }
191
192 absl::Span<const AttributeQualifier> qualifier_path() const {
193 return impl_->qualifier_path;
194 }
195
196 bool operator==(const Attribute& other) const;
197
198 bool operator<(const Attribute& other) const;
199
200 const absl::StatusOr<std::string> AsString() const;
201
202 private:
203 struct Impl final {
204 Impl(std::string variable_name,
205 std::vector<AttributeQualifier> qualifier_path)
206 : variable_name(std::move(variable_name)),
207 qualifier_path(std::move(qualifier_path)) {}
208
209 std::string variable_name;
210 std::vector<AttributeQualifier> qualifier_path;
211 };
212
213 std::shared_ptr<const Impl> impl_;
214};
215
216// AttributePattern is a fully-qualified absolute attribute path pattern.
217// Supported segments steps in the path are:

Callers 11

TESTFunction · 0.85
TEST_FFunction · 0.85
TESTFunction · 0.85
StepMethod · 0.85
TESTFunction · 0.85
TEST_PFunction · 0.85
GetAttributeTrailMethod · 0.85
TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by 7

TESTFunction · 0.68
TEST_FFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TEST_PFunction · 0.68
TEST_FFunction · 0.68