CLI  2.9
Map< K, T > Class Template Reference

Basic map object. More...

#include <tk_stl.h>

Inheritance diagram for Map< K, T >:

Classes

class  Iterator
 Iterator object. More...
 

Public Member Functions

 Map (const unsigned int UI_MaxCount)
 Main constructor. More...
 
 Map (const Map< K, T > &TK_Map)
 Copy constructor. More...
 
virtual ~Map (void)
 Destructor. More...
 
const bool IsEmpty (void) const
 Determines whether the map is empty. More...
 
const unsigned int GetCount (void) const
 Item count. More...
 
const bool Reset (void)
 Resets the map. More...
 
const bool SetAt (const K &K_Key, const T &T_Value)
 Set a new item. More...
 
const bool Unset (const K &K_Key)
 Unset an item. More...
 
const bool IsSet (const K &K_Key) const
 Checks whether an element is set for this key. More...
 
const T *const GetAt (const K &K_Key) const
 Element accessor. More...
 
Iterator GetIterator (void) const
 Iterator retrieval. More...
 
const bool IsValid (const Iterator &it) const
 Checks the element at the given position is valid. More...
 
const bool MoveNext (Iterator &it) const
 Iterates the iterator. More...
 
const K & GetKey (const Iterator &it) const
 Key retrieval. More...
 
const T & GetAt (const Iterator &it) const
 Read-only item retrieval. More...
 
T & GetAt (const Iterator &it)
 Modifiable item retrieval. More...
 
const T Remove (Iterator &it)
 Item removal. More...
 

Detailed Description

template<class K, class T>
class Map< K, T >

Basic map object.

Definition at line 615 of file tk_stl.h.

Constructor & Destructor Documentation

◆ Map() [1/2]

template<class K, class T>
Map< K, T >::Map ( const unsigned int  UI_MaxCount)
inlineexplicit

Main constructor.

Parameters
UI_MaxCountMaximum item count.

Definition at line 623 of file tk_stl.h.

◆ Map() [2/2]

template<class K, class T>
Map< K, T >::Map ( const Map< K, T > &  TK_Map)
inline

Copy constructor.

Parameters
TK_MapSource map object.

Definition at line 631 of file tk_stl.h.

◆ ~Map()

template<class K, class T>
virtual Map< K, T >::~Map ( void  )
inlinevirtual

Destructor.

Definition at line 639 of file tk_stl.h.

Member Function Documentation

◆ GetAt() [1/3]

template<class K, class T>
const T* const Map< K, T >::GetAt ( const K &  K_Key) const
inline

Element accessor.

Returns
NULL if no element is set for this key.
Parameters
K_KeyKey of the element accessed.

Definition at line 709 of file tk_stl.h.

Referenced by Map< K, T >::Remove().

◆ GetAt() [2/3]

template<class K, class T>
const T& Map< K, T >::GetAt ( const Iterator it) const
inline

Read-only item retrieval.

Returns
Read-only value of the element pointed by the iterator.
Parameters
itCurrent iterator.

Definition at line 795 of file tk_stl.h.

◆ GetAt() [3/3]

template<class K, class T>
T& Map< K, T >::GetAt ( const Iterator it)
inline

Modifiable item retrieval.

Returns
Modifiable value of the element pointed by the iterator.
Parameters
itCurrent iterator.

Definition at line 804 of file tk_stl.h.

◆ GetCount()

template<class K, class T>
const unsigned int Map< K, T >::GetCount ( void  ) const
inline

Item count.

Returns
The number of items in the map.

Definition at line 657 of file tk_stl.h.

◆ GetIterator()

template<class K, class T>
Iterator Map< K, T >::GetIterator ( void  ) const
inline

Iterator retrieval.

Returns
Iterator instance.

Definition at line 758 of file tk_stl.h.

◆ GetKey()

template<class K, class T>
const K& Map< K, T >::GetKey ( const Iterator it) const
inline

Key retrieval.

Returns
Key of the element pointed by the iterator.
Parameters
itCurrent iterator.

Definition at line 786 of file tk_stl.h.

◆ IsEmpty()

template<class K, class T>
const bool Map< K, T >::IsEmpty ( void  ) const
inline

Determines whether the map is empty.

Returns
true when the map is empty, false otherwise.

Definition at line 650 of file tk_stl.h.

◆ IsSet()

template<class K, class T>
const bool Map< K, T >::IsSet ( const K &  K_Key) const
inline

Checks whether an element is set for this key.

Returns
true if the key is set, false otherwise.
Parameters
K_KeyKey to check.

Definition at line 700 of file tk_stl.h.

◆ IsValid()

template<class K, class T>
const bool Map< K, T >::IsValid ( const Iterator it) const
inline

Checks the element at the given position is valid.

Returns
true when the iterator is at a valid place, false otherwise.
Parameters
itIterator to check.

Definition at line 767 of file tk_stl.h.

Referenced by Map< K, T >::MoveNext().

◆ MoveNext()

template<class K, class T>
const bool Map< K, T >::MoveNext ( Iterator it) const
inline

Iterates the iterator.

Returns
true if the iterator has moved to a valid place, false otherwise.
Parameters
itIterator to move forward.

Definition at line 776 of file tk_stl.h.

References Map< K, T >::IsValid().

◆ Remove()

template<class K, class T>
const T Map< K, T >::Remove ( Iterator it)
inline

Item removal.

Parameters
itPosition. Set to next item.
Returns
The remove element.
Parameters
itCurrent iterator.

Definition at line 814 of file tk_stl.h.

References Map< K, T >::GetAt().

◆ Reset()

template<class K, class T>
const bool Map< K, T >::Reset ( void  )
inline

Resets the map.

Returns
true when success, false otherwise.
Author
[contrib: Oleg Smolsky, 2010, based on CLI 2.5]

Definition at line 666 of file tk_stl.h.

◆ SetAt()

template<class K, class T>
const bool Map< K, T >::SetAt ( const K &  K_Key,
const T &  T_Value 
)
inline

Set a new item.

Returns
true if the element has been set, false otherwise.
Parameters
K_KeyKey of the element set.
T_ValueValue of the element set.

Definition at line 675 of file tk_stl.h.

◆ Unset()

template<class K, class T>
const bool Map< K, T >::Unset ( const K &  K_Key)
inline

Unset an item.

Returns
true if the element has been unset correctly, or if the element was not set, false otherwise.
Parameters
K_KeyKey of the element unset.

Definition at line 690 of file tk_stl.h.


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