Base Framework
Public Member Functions | List of all members
Association< KEY, VALUE > Class Template Reference

Association of value with value. More...

#include <base/collection/Association.h>

Public Member Functions

 Association ()
 
 Association (const KEY &_key)
 
 Association (KEY &&_key)
 
 Association (const Association &copy)
 
 Association (Association &&move)
 
 Association (const KEY &_key, const VALUE &_value)
 
 Association (const KEY &_key, VALUE &&_value)
 
 Association (KEY &&_key, VALUE &&_value)
 
 Association (KEY &&_key, const VALUE &_value)
 
Associationoperator= (const Association &assign)
 
Associationoperator= (Association &&assign)
 
const KEY & getKey () const noexcept
 
VALUE & getValue () noexcept
 
const VALUE & getValue () const noexcept
 
void setValue (const VALUE &value)
 
void setValue (VALUE &&value)
 
bool operator== (const Association &compare) const
 
bool operator!= (const Association &compare) const
 
bool operator< (const Association &compare) const
 
bool operator<= (const Association &compare) const
 
bool operator>= (const Association &compare) const
 
bool operator> (const Association &compare) const
 
bool operator== (const KEY &compare) const
 
bool operator!= (const KEY &compare) const
 
bool operator< (const KEY &compare) const
 
bool operator<= (const KEY &compare) const
 
bool operator>= (const KEY &compare) const
 
bool operator> (const KEY &compare) const
 
 operator const KEY & () const noexcept
 

Detailed Description

template<class KEY, class VALUE>
class Association< KEY, VALUE >

Association of value with value.

Association of value with other value. An association has the properties of its key (i.e. the key is the only significant when comparing associations with each other). The value of the association is the associated value.

See also
Map
Version
1.0

Constructor & Destructor Documentation

◆ Association() [1/9]

template<class KEY , class VALUE >
Association< KEY, VALUE >::Association ( )
inline

Default initializes association.

◆ Association() [2/9]

template<class KEY , class VALUE >
Association< KEY, VALUE >::Association ( const KEY &  _key)
inline

Initializes association with the specified key and uninitalized value.

Parameters
keyThe key.

◆ Association() [3/9]

template<class KEY , class VALUE >
Association< KEY, VALUE >::Association ( KEY &&  _key)
inline

Initializes association with the specified key and uninitalized value.

Parameters
keyThe key.

◆ Association() [4/9]

template<class KEY , class VALUE >
Association< KEY, VALUE >::Association ( const Association< KEY, VALUE > &  copy)
inline

Initializes association from other association.

◆ Association() [5/9]

template<class KEY , class VALUE >
Association< KEY, VALUE >::Association ( Association< KEY, VALUE > &&  move)
inline

Initializes association from other association.

◆ Association() [6/9]

template<class KEY , class VALUE >
Association< KEY, VALUE >::Association ( const KEY &  _key,
const VALUE &  _value 
)
inline

Initializes association with the specified key and value.

Parameters
keyThe key.
valueThe value of the association.

◆ Association() [7/9]

template<class KEY , class VALUE >
Association< KEY, VALUE >::Association ( const KEY &  _key,
VALUE &&  _value 
)
inline

Initializes association with the specified key and value.

Parameters
keyThe key.
valueThe value of the association.

◆ Association() [8/9]

template<class KEY , class VALUE >
Association< KEY, VALUE >::Association ( KEY &&  _key,
VALUE &&  _value 
)
inline

Initializes association with the specified key and value.

Parameters
keyThe key.
valueThe value of the association.

◆ Association() [9/9]

template<class KEY , class VALUE >
Association< KEY, VALUE >::Association ( KEY &&  _key,
const VALUE &  _value 
)
inline

Initializes association with the specified key and value.

Parameters
keyThe key.
valueThe value of the association.

Member Function Documentation

◆ getKey()

template<class KEY , class VALUE >
const KEY& Association< KEY, VALUE >::getKey ( ) const
inlinenoexcept

Returns the key value of the association.

◆ getValue() [1/2]

template<class KEY , class VALUE >
const VALUE& Association< KEY, VALUE >::getValue ( ) const
inlinenoexcept

Returns the value of the association.

◆ getValue() [2/2]

template<class KEY , class VALUE >
VALUE& Association< KEY, VALUE >::getValue ( )
inlinenoexcept

Returns the value of the association.

◆ operator const KEY &()

template<class KEY , class VALUE >
Association< KEY, VALUE >::operator const KEY & ( ) const
inlinenoexcept

Returns the key value of the association. Requires for implicit comparison.

◆ operator!=() [1/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator!= ( const Association< KEY, VALUE > &  compare) const
inline

Returns true if the associations are not equal.

◆ operator!=() [2/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator!= ( const KEY &  compare) const
inline

Returns true if the associations are not equal.

◆ operator<() [1/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator< ( const Association< KEY, VALUE > &  compare) const
inline

Returns true if this association is less than the specified association.

◆ operator<() [2/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator< ( const KEY &  compare) const
inline

Returns true if this association is less than the specified association.

◆ operator<=() [1/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator<= ( const Association< KEY, VALUE > &  compare) const
inline

Returns true if this association is less than or equal to the specified association.

◆ operator<=() [2/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator<= ( const KEY &  compare) const
inline

Returns true if this association is less than or equal to the specified association.

◆ operator==() [1/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator== ( const Association< KEY, VALUE > &  compare) const
inline

Returns true if the associations are equal.

◆ operator==() [2/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator== ( const KEY &  compare) const
inline

Returns true if the associations are equal.

◆ operator>() [1/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator> ( const Association< KEY, VALUE > &  compare) const
inline

Returns true if this association is greater that the specified association.

◆ operator>() [2/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator> ( const KEY &  compare) const
inline

Returns true if this association is greater than the specified association.

◆ operator>=() [1/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator>= ( const Association< KEY, VALUE > &  compare) const
inline

Returns true if this association is greater than or equal to the specified association.

◆ operator>=() [2/2]

template<class KEY , class VALUE >
bool Association< KEY, VALUE >::operator>= ( const KEY &  compare) const
inline

Returns true if this association is less than or equal to the specified association.

◆ setValue() [1/2]

template<class KEY , class VALUE >
void Association< KEY, VALUE >::setValue ( const VALUE &  value)
inline

Sets the value of the association.

Parameters
valueThe new value.

◆ setValue() [2/2]

template<class KEY , class VALUE >
void Association< KEY, VALUE >::setValue ( VALUE &&  value)
inline

Sets the value of the association.

Parameters
valueThe new value.