The Nebula Device 3: Util::KeyValuePair< KEYTYPE, VALUETYPE > Class Template Reference

The Nebula Device 3

Util::KeyValuePair< KEYTYPE, VALUETYPE > Class Template Reference

#include <keyvaluepair.h>

Inheritance diagram for Util::KeyValuePair< KEYTYPE, VALUETYPE >:

< KEYTYPE, VALUETYPE >_map" border="0" alt="">
< KEYTYPE, VALUETYPE >_map"> Attr::Attribute


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.

(C) 2006 Radon Labs GmbH


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
void operator= (const KeyValuePair< KEYTYPE, VALUETYPE > &rhs)
 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
VALUETYPE & Value ()
 read/write access to value
const KEYTYPE & Key () const
 read access to key
const VALUETYPE & Value () const
 read access to key


Constructor & Destructor Documentation

template<class KEYTYPE, class VALUETYPE>
Util::KeyValuePair< KEYTYPE, VALUETYPE >::KeyValuePair ( const KEYTYPE &  k  )  [inline]

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.