Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

CB2::PMap< Tkey, Tvalue > Class Template Reference

Map key to value. More...

#include <utils.h>

Inheritance diagram for CB2::PMap< Tkey, Tvalue >:

CB2::Class List of all members.

Public Types

typedef PMap< Tkey, Tvalue > this_type
 Template type alias.


Public Member Functions

 PMap (const Tkey &key, const Tvalue &value)
 Constructor.

 PMap (const Tkey &key)
 Constructor.

 PMap (const this_type &prev)
 Copy constructor.

const this_typeoperator= (const this_type &prev)
 Assignment operator Copy key=value pair from another Map.

const Tkey & GetKey () const
 Get key.

const Tvalue & GetValue () const
 Get value.

bool IsNULL () const
 Check NULL.


Public Attributes

int tag
 Tag for user-specific data.


Private Attributes

Tkey _key
 Data item key.

Tvalue _value
 Data item value.

bool _null
 Value is NULL (SQL syntax).


Detailed Description

template<class Tkey, class Tvalue>
class CB2::PMap< Tkey, Tvalue >

Map key to value.

This template stores a tuple of values, where the first one is considered 'key' and the other (which might not be present, see the SQL 'NULL' semantics) is considered 'value'.


Member Typedef Documentation

template<class Tkey, class Tvalue>
typedef PMap< Tkey, Tvalue> CB2::PMap< Tkey, Tvalue >::this_type
 

Template type alias.


Constructor & Destructor Documentation

template<class Tkey, class Tvalue>
CB2::PMap< Tkey, Tvalue >::PMap const Tkey &  key,
const Tvalue &  value
[inline]
 

Constructor.

Assign key to value.

Parameters:
key Key.
value Value.

template<class Tkey, class Tvalue>
CB2::PMap< Tkey, Tvalue >::PMap const Tkey &  key  )  [inline]
 

Constructor.

Assign a 'NULL' value to key.

Parameters:
key Key.

template<class Tkey, class Tvalue>
CB2::PMap< Tkey, Tvalue >::PMap const this_type prev  )  [inline]
 

Copy constructor.

Copy key=value pair from another Map.

Parameters:
prev Map to copy from.


Member Function Documentation

template<class Tkey, class Tvalue>
const Tkey& CB2::PMap< Tkey, Tvalue >::GetKey  )  const [inline]
 

Get key.

Returns:
Key.

template<class Tkey, class Tvalue>
const Tvalue& CB2::PMap< Tkey, Tvalue >::GetValue  )  const [inline]
 

Get value.

Get the value. If the value is NULL, ExceptionAssert is thrown.

Returns:
Value.

template<class Tkey, class Tvalue>
bool CB2::PMap< Tkey, Tvalue >::IsNULL  )  const [inline]
 

Check NULL.

Returns:
True if the value is NULL.

template<class Tkey, class Tvalue>
const this_type& CB2::PMap< Tkey, Tvalue >::operator= const this_type prev  )  [inline]
 

Assignment operator Copy key=value pair from another Map.

Parameters:
prev Map to copy from.
Returns:
Reference to this.


Member Data Documentation

template<class Tkey, class Tvalue>
Tkey CB2::PMap< Tkey, Tvalue >::_key [private]
 

Data item key.

template<class Tkey, class Tvalue>
bool CB2::PMap< Tkey, Tvalue >::_null [private]
 

Value is NULL (SQL syntax).

template<class Tkey, class Tvalue>
Tvalue CB2::PMap< Tkey, Tvalue >::_value [private]
 

Data item value.

int CB2::Class::tag [inherited]
 

Tag for user-specific data.


The documentation for this class was generated from the following file:
Generated on Thu Sep 16 23:26:49 2004 for ColorBox2 by doxygen 1.3.7