5 #include <launchdarkly/attribute_reference.hpp>
6 #include <launchdarkly/attributes.hpp>
7 #include <launchdarkly/value.hpp>
9 namespace launchdarkly {
21 template <
class BuilderReturn,
class BuildType>
34 : key_(std::move(key)), kind_(std::move(kind)), builder_(builder) {}
47 : key_(attributes.Key()),
48 kind_(std::move(kind)),
50 name_(attributes.
Name()),
52 private_attributes_(attributes.PrivateAttributes()) {
54 values_[pair.first] = pair.second;
177 template <
typename IterType>
179 for (
auto iter : attributes) {
180 private_attributes_.insert(iter);
198 return builder_.Kind(kind, key);
209 return builder_.Kind(kind);
217 [[nodiscard]] BuildType
Build()
const {
return builder_.Build(); }
220 BuilderReturn& builder_;
227 void Key(std::string key) { key_ = std::move(key); }
229 Attributes BuildAttributes()
const;
233 bool private_attribute);
238 bool anonymous_ =
false;
240 std::map<std::string, launchdarkly::Value> values_;
241 AttributeReference::SetType private_attributes_;
Definition: attribute_reference.hpp:34
Definition: attributes_builder.hpp:22
AttributesBuilder(BuilderReturn &builder, std::string kind, Attributes const &attributes)
Definition: attributes_builder.hpp:44
AttributesBuilder & Set(std::string name, launchdarkly::Value value)
AttributesBuilder(BuilderReturn &builder, std::string kind, std::string key)
Definition: attributes_builder.hpp:33
AttributesBuilder & Kind(std::string kind, std::string key)
Definition: attributes_builder.hpp:197
BuildType Build() const
Definition: attributes_builder.hpp:217
AttributesBuilder & SetPrivate(std::string name, launchdarkly::Value value)
AttributesBuilder & Name(std::string name)
AttributesBuilder & AddPrivateAttributes(IterType attributes)
Definition: attributes_builder.hpp:178
AttributesBuilder * Kind(std::string const &kind)
Definition: attributes_builder.hpp:208
AttributesBuilder(AttributesBuilder const &builder)=delete
AttributesBuilder & Anonymous(bool anonymous)
AttributesBuilder & AddPrivateAttribute(AttributeReference ref)
Definition: attributes.hpp:15
Value const & CustomAttributes() const
Definition: attributes.cpp:17
Definition: context_builder.hpp:62
Object const & AsObject() const
Definition: value.cpp:121