ADTF  3.18.2
KeyValuePair

observable KeyValuePair More...

Inheritance diagram for KeyValuePair:
[legend]

Public Member Functions

 KeyValuePair ()=default
 Construct a observable new Key Value Pair.
 
 KeyValuePair (const KeyValuePair &)=default
 copy CTOR
 
 KeyValuePair (KeyValuePair &&)=default
 move CTOR
 
KeyValuePairoperator= (const KeyValuePair &)=default
 copy assignment operator More...
 
KeyValuePairoperator= (KeyValuePair &&)=default
 move assignment operator More...
 
 KeyValuePair (const std::string &name_key, const std::string &value_type)
 CTOR. More...
 
virtual ~KeyValuePair ()=default
 DTOR.
 
bool operator== (const KeyValuePair &other) const
 equality operator. More...
 
bool operator!= (const KeyValuePair &other) const
 non-equality operator. More...
 
const std::string & getName () const
 Get the Name (same as key) More...
 
void setName (const std::string &name)
 Sets the Name (same as key) More...
 
const std::string & getKey () const
 Get the Key (same as name) More...
 
void setKey (const std::string &key)
 Set the Key (same as name) More...
 
const std::string & getValue () const
 Get the Value (same as type) More...
 
void setValue (const std::string &value)
 Set the Value (same as type) More...
 
const std::string & getType () const
 Get the Type (same as value) More...
 
void setType (const std::string &type)
 Set the Type (same as value) More...
 
- Public Member Functions inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
 ModelSubjectUtility ()=default
 CTOR.
 
 ModelSubjectUtility (const ModelSubjectUtility &)
 copy CTOR which removes the observers in case of!
 
ModelSubjectUtilityoperator= (const ModelSubjectUtility &)
 copy assignment operator which removes the observers in case of! More...
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify. More...
 
void detachObserver (observer_type *observer)
 remove a observer if in list. More...
 
- Public Member Functions inherited from InfoMap
 InfoMap ()=default
 CTOR.
 
 InfoMap (const InfoMap &)
 copy CTOR More...
 
 InfoMap (InfoMap &&)
 move CTOR More...
 
InfoMapoperator= (const InfoMap &)
 copy assignment operator More...
 
InfoMapoperator= (InfoMap &&)
 move assignment operator More...
 
template<typename INFO_T >
const INFO_T * getInfo () const
 Get the Info Pointer. More...
 
template<typename INFO_T >
INFO_T * getInfo ()
 Get the Info Pointer. More...
 
template<typename INFO_T >
void setInfo (const std::shared_ptr< INFO_T > &info)
 Set the Info object as shared pointer. More...
 

Private Attributes

std::string _name_key
 
std::string _value_type
 

Additional Inherited Members

- Public Types inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
typedef EVENT_CODE_T event_code_type
 local definition of the event code type
 
typedef MODEL_SUBJECT_T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< MODEL_SUBJECT_T, EVENT_CODE_T > observer_type
 local definition of the observer type to notify
 
- Protected Member Functions inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers More...
 

Detailed Description

observable KeyValuePair

Definition at line 33 of file datamodel_keyvalue.h.

Constructor & Destructor Documentation

◆ KeyValuePair()

KeyValuePair ( const std::string &  name_key,
const std::string &  value_type 
)

CTOR.

Parameters
name_keyThe name or key of the pair.
value_typeThe value or type of the pair.

Member Function Documentation

◆ getKey()

const std::string& getKey ( ) const

Get the Key (same as name)

Returns
const std::string&

◆ getName()

const std::string& getName ( ) const

Get the Name (same as key)

Returns
const std::string&

◆ getType()

const std::string& getType ( ) const

Get the Type (same as value)

Returns
const std::string&

◆ getValue()

const std::string& getValue ( ) const

Get the Value (same as type)

Returns
const std::string&

◆ operator!=()

bool operator!= ( const KeyValuePair other) const

non-equality operator.

Parameters
otherthe other key valu to compare
Returns
false the key and value are equal.
true the key and value are not equal.

◆ operator=() [1/2]

KeyValuePair& operator= ( const KeyValuePair )
default

copy assignment operator

Returns
KeyValuePair&

◆ operator=() [2/2]

KeyValuePair& operator= ( KeyValuePair &&  )
default

move assignment operator

Returns
KeyValuePair&

◆ operator==()

bool operator== ( const KeyValuePair other) const

equality operator.

Parameters
otherthe other key valu to compare
Returns
true the key and value are equal.
false the key and value are not equal.

◆ setKey()

void setKey ( const std::string &  key)

Set the Key (same as name)

Parameters
keythe key
Remarks
This change is observable.
Exceptions
Eachchange may throw if a value with this key already exists.

◆ setName()

void setName ( const std::string &  name)

Sets the Name (same as key)

Parameters
namethe name to set
Remarks
This change is observable.
Exceptions
Eachchange may throw if a value with this name already exists.

◆ setType()

void setType ( const std::string &  type)

Set the Type (same as value)

Parameters
typethe type to set.
Remarks
This change is observable.

◆ setValue()

void setValue ( const std::string &  value)

Set the Value (same as type)

Parameters
valuethe value
Remarks
This change is observable.