4 #include <unordered_set>
6 #include <launchdarkly/attribute_reference.hpp>
7 #include <launchdarkly/value.hpp>
9 namespace launchdarkly {
21 std::string
const&
Key()
const;
29 std::string
const&
Name()
const;
67 if (ref.
Depth() == 1) {
82 for (
size_t index = 0; index < ref.
Depth(); index++) {
83 auto const& component = ref.
Component(index);
86 if (
auto search = map.Find(component); search != map.end()) {
87 node = &search->second;
113 std::optional<std::string> name,
116 AttributeReference::SetType private_attributes =
117 AttributeReference::SetType())
118 : key_(std::move(key)),
119 name_(std::move(name)),
120 anonymous_(anonymous),
121 private_attributes_(std::move(private_attributes)),
122 custom_attributes_(std::move(attributes)) {}
124 friend std::ostream& operator<<(std::ostream& out,
126 out <<
"{key: " << attrs.key_ <<
", "
127 <<
" name: " << attrs.name_ <<
" anonymous: " << attrs.anonymous_
130 for (
auto const& private_attribute : attrs.private_attributes_) {
136 out << private_attribute;
139 <<
" custom: " << attrs.custom_attributes_ <<
"}";
159 AttributeReference::SetType private_attributes_;
Definition: attribute_reference.hpp:34
bool IsKind() const
Definition: attribute_reference.cpp:215
bool Valid() const
Definition: attribute_reference.cpp:219
std::size_t Depth() const
Definition: attribute_reference.cpp:211
std::string const & Component(std::size_t depth) const
Definition: attribute_reference.cpp:204
Definition: attributes.hpp:15
launchdarkly::Value const & Get(launchdarkly::AttributeReference const &ref) const
Definition: attributes.hpp:56
Value const & CustomAttributes() const
Definition: attributes.cpp:17
bool Anonymous() const
Definition: attributes.cpp:13
AttributeReference::SetType const & PrivateAttributes() const
Definition: attributes.cpp:21
Attributes(std::string key, std::optional< std::string > name, bool anonymous, launchdarkly::Value attributes, AttributeReference::SetType private_attributes=AttributeReference::SetType())
Definition: attributes.hpp:112
std::string const & Key() const
Definition: attributes.cpp:5
std::string const & Name() const
Definition: attributes.cpp:9
Object const & AsObject() const
Definition: value.cpp:121
bool IsObject() const
Definition: value.cpp:76
static Value const & Null()
Definition: value.cpp:80