ADTF
Loading...
Searching...
No Matches
datamodel_keyvalue.h
Go to the documentation of this file.
1
14
15#ifndef DD_DATA_MODEL_KEYVALUE_H_INCLUDED
16#define DD_DATA_MODEL_KEYVALUE_H_INCLUDED
17
20
21#include <string>
22
23namespace ddl {
24
25namespace dd {
26
27namespace datamodel {
28
33class KeyValuePair : public utility::TypeAccessMapSubject<KeyValuePair>, public InfoMap {
34public:
39 KeyValuePair() = default;
44 KeyValuePair(const KeyValuePair&) = default;
68 KeyValuePair(std::string name_key, std::string value_type);
73 virtual ~KeyValuePair() = default;
74
82 bool operator==(const KeyValuePair& other) const;
90 bool operator!=(const KeyValuePair& other) const;
91
97 const std::string& getName() const;
105 void setName(const std::string& name);
106
112 const std::string& getKey() const;
120 void setKey(const std::string& key);
121
127 const std::string& getValue() const;
134 void setValue(const std::string& value);
135
141 const std::string& getType() const;
148 void setType(const std::string& type);
149
150private:
151 std::string _name_key;
152 std::string _value_type;
153};
154
155} // namespace datamodel
156} // namespace dd
157} // namespace ddl
158
160{
169 static constexpr auto _other_types = "";
177 };
178}
179
180#endif // DD_DATA_MODEL_KEYVALUE_H_INCLUDED
observable KeyValuePair
Definition datamodel_keyvalue.h:33
KeyValuePair(KeyValuePair &&)=default
move CTOR
bool operator!=(const KeyValuePair &other) const
non-equality operator.
KeyValuePair & operator=(const KeyValuePair &)=default
copy assignment operator
void setName(const std::string &name)
Sets the Name (same as key)
const std::string & getType() const
Get the Type (same as value)
void setValue(const std::string &value)
Set the Value (same as type)
bool operator==(const KeyValuePair &other) const
equality operator.
const std::string & getValue() const
Get the value (same as type)
void setType(const std::string &type)
Set the Type (same as value)
const std::string & getKey() const
Get the Key (same as name)
KeyValuePair & operator=(KeyValuePair &&)=default
move assignment operator
KeyValuePair()=default
Construct a observable new Key Value Pair.
KeyValuePair(std::string name_key, std::string value_type)
CTOR.
const std::string & getName() const
Get the Name (same as key)
virtual ~KeyValuePair()=default
DTOR.
KeyValuePair(const KeyValuePair &)=default
copy CTOR
void setKey(const std::string &key)
Set the Key (same as name)
definition of the datamodel namespace
Definition datamodel_base.h:28
Definition datamodel_keyvalue.h:160
ModelSubjectUtility< T, TypeAccessMapEventCode > TypeAccessMapSubject
helper template to observe map content.
Definition access_map.h:61
definition of the dd namespace
Definition datamodel_base.h:26
definition of the ddl namespace
Definition codec.h:21
static std::string getDifference(const ddl::dd::datamodel::KeyValuePair &left, const ddl::dd::datamodel::KeyValuePair &right)
Get the Difference.
static constexpr auto _other_types
validation other type
Definition datamodel_keyvalue.h:169
Validation helper template for clear excpetion messages.
Definition access_validation.h:37