Nebula
Loading...
Searching...
No Matches
Util::KeyValuePair< KEYTYPE, VALUETYPE > Class Template Reference

#include <keyvaluepair.h>

Detailed Description

template<class KEYTYPE, class VALUETYPE>
class Util::KeyValuePair< KEYTYPE, VALUETYPE >

Key/Value pair objects are used by most assiociative container classes, like Dictionary or HashTable.

Public Member Functions

 KeyValuePair ()
 default constructor
 
 KeyValuePair (const KEYTYPE &k, const VALUETYPE &v)
 constructor with key and value
 
 KeyValuePair (const KEYTYPE &k)
 constructor with key and undefined value
 
 KeyValuePair (const KeyValuePair< KEYTYPE, VALUETYPE > &rhs)
 copy constructor
 
 KeyValuePair (KeyValuePair< KEYTYPE, VALUETYPE > &&rhs) noexcept
 move constructor
 
void operator= (const KeyValuePair< KEYTYPE, VALUETYPE > &rhs)
 assignment operator
 
void operator= (KeyValuePair< KEYTYPE, VALUETYPE > &&rhs) noexcept
 move assignment operator
 
bool operator== (const KeyValuePair< KEYTYPE, VALUETYPE > &rhs) const
 equality operator
 
bool operator!= (const KeyValuePair< KEYTYPE, VALUETYPE > &rhs) const
 inequality operator
 
bool operator> (const KeyValuePair< KEYTYPE, VALUETYPE > &rhs) const
 greater operator
 
bool operator>= (const KeyValuePair< KEYTYPE, VALUETYPE > &rhs) const
 greater-or-equal operator
 
bool operator< (const KeyValuePair< KEYTYPE, VALUETYPE > &rhs) const
 lesser operator
 
bool operator<= (const KeyValuePair< KEYTYPE, VALUETYPE > &rhs) const
 lesser-or-equal operator
 
bool operator== (const KEYTYPE &rhs) const
 equality operator
 
bool operator!= (const KEYTYPE &rhs) const
 inequality operator
 
bool operator> (const KEYTYPE &rhs) const
 greater operator
 
bool operator>= (const KEYTYPE &rhs) const
 greater-or-equal operator
 
bool operator< (const KEYTYPE &rhs) const
 lesser operator
 
bool operator<= (const KEYTYPE &rhs) const
 lesser-or-equal operator
 
VALUETYPE & Value ()
 read/write access to value
 
const KEYTYPE & Key () const
 read access to key
 
const VALUETYPE & Value () const
 read access to key
 

Public Attributes

KEYTYPE keyData = KEYTYPE()
 
VALUETYPE valueData = VALUETYPE()
 

Constructor & Destructor Documentation

◆ KeyValuePair() [1/5]

template<class KEYTYPE , class VALUETYPE >
Util::KeyValuePair< KEYTYPE, VALUETYPE >::KeyValuePair ( )

default constructor

◆ KeyValuePair() [2/5]

template<class KEYTYPE , class VALUETYPE >
Util::KeyValuePair< KEYTYPE, VALUETYPE >::KeyValuePair ( const KEYTYPE & k,
const VALUETYPE & v )

constructor with key and value

◆ KeyValuePair() [3/5]

template<class KEYTYPE , class VALUETYPE >
Util::KeyValuePair< KEYTYPE, VALUETYPE >::KeyValuePair ( const KEYTYPE & k)
explicit

constructor with key and undefined value

This strange constructor is useful for search-by-key if the key-value-pairs are stored in a Util::Array.

◆ KeyValuePair() [4/5]

template<class KEYTYPE , class VALUETYPE >
Util::KeyValuePair< KEYTYPE, VALUETYPE >::KeyValuePair ( const KeyValuePair< KEYTYPE, VALUETYPE > & rhs)

copy constructor

◆ KeyValuePair() [5/5]

template<class KEYTYPE , class VALUETYPE >
Util::KeyValuePair< KEYTYPE, VALUETYPE >::KeyValuePair ( KeyValuePair< KEYTYPE, VALUETYPE > && rhs)
noexcept

move constructor

Member Function Documentation

◆ Key()

template<class KEYTYPE , class VALUETYPE >
const KEYTYPE & Util::KeyValuePair< KEYTYPE, VALUETYPE >::Key ( ) const

read access to key

◆ operator!=() [1/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator!= ( const KEYTYPE & rhs) const

inequality operator

◆ operator!=() [2/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator!= ( const KeyValuePair< KEYTYPE, VALUETYPE > & rhs) const

inequality operator

◆ operator<() [1/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator< ( const KEYTYPE & rhs) const

lesser operator

◆ operator<() [2/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator< ( const KeyValuePair< KEYTYPE, VALUETYPE > & rhs) const

lesser operator

◆ operator<=() [1/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator<= ( const KEYTYPE & rhs) const

lesser-or-equal operator

◆ operator<=() [2/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator<= ( const KeyValuePair< KEYTYPE, VALUETYPE > & rhs) const

lesser-or-equal operator

◆ operator=() [1/2]

template<class KEYTYPE , class VALUETYPE >
void Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator= ( const KeyValuePair< KEYTYPE, VALUETYPE > & rhs)

assignment operator

◆ operator=() [2/2]

template<class KEYTYPE , class VALUETYPE >
void Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator= ( KeyValuePair< KEYTYPE, VALUETYPE > && rhs)
noexcept

move assignment operator

◆ operator==() [1/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator== ( const KEYTYPE & rhs) const

equality operator

◆ operator==() [2/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator== ( const KeyValuePair< KEYTYPE, VALUETYPE > & rhs) const

equality operator

◆ operator>() [1/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator> ( const KEYTYPE & rhs) const

greater operator

◆ operator>() [2/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator> ( const KeyValuePair< KEYTYPE, VALUETYPE > & rhs) const

greater operator

◆ operator>=() [1/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator>= ( const KEYTYPE & rhs) const

greater-or-equal operator

◆ operator>=() [2/2]

template<class KEYTYPE , class VALUETYPE >
bool Util::KeyValuePair< KEYTYPE, VALUETYPE >::operator>= ( const KeyValuePair< KEYTYPE, VALUETYPE > & rhs) const

greater-or-equal operator

◆ Value() [1/2]

template<class KEYTYPE , class VALUETYPE >
VALUETYPE & Util::KeyValuePair< KEYTYPE, VALUETYPE >::Value ( )

read/write access to value

◆ Value() [2/2]

template<class KEYTYPE , class VALUETYPE >
const VALUETYPE & Util::KeyValuePair< KEYTYPE, VALUETYPE >::Value ( ) const

read access to key

Member Data Documentation

◆ keyData

template<class KEYTYPE , class VALUETYPE >
KEYTYPE Util::KeyValuePair< KEYTYPE, VALUETYPE >::keyData = KEYTYPE()

◆ valueData

template<class KEYTYPE , class VALUETYPE >
VALUETYPE Util::KeyValuePair< KEYTYPE, VALUETYPE >::valueData = VALUETYPE()

The documentation for this class was generated from the following file: