ICF 3.0.5.47
Technical documentation of ICF Libraries
istd::TCascadedMap< Key, Value > Class Template Reference

Helper class used to manage list of many connected in cascade maps. More...

#include <TCascadedMap.h>

Inheritance diagram for istd::TCascadedMap< Key, Value >:
Collaboration diagram for istd::TCascadedMap< Key, Value >:

Public Member Functions

 TCascadedMap ()
 Default constructor.
 
 TCascadedMap (const TCascadedMap< Key, Value > *parentPtr)
 Constructor with assigning of parent map.
 
 TCascadedMap (const TCascadedMap &map)
 Copy constructor.
 
const TCascadedMap< Key, Value > * GetParent () const
 Get access to parent map instance.
 
void SetParent (const TIMap< Key, Value > *parentPtr)
 Set instance of parent map.
 
int FindLocalIndex (const KeyType &key) const
 Find index index of specified key using local context only.
 
const ValueTypeFindLocalElement (const KeyType &key) const
 Find value element associated with specified key using local context only.
 
ValueTypeFindLocalElement (const KeyType &key)
 Find value element associated with specified key using local context only.
 
const KeyTypeGetLocalKeyAt (int index) const
 Get key value from local context at specified index.
 
KeyTypeGetLocalKeyAt (int index)
 Get key value from local context at specified index.
 
const ValueTypeGetLocalValueAt (int index) const
 Get mapped value from local context at specified index.
 
ValueTypeGetLocalValueAt (int index)
 Get mapped value from local context at specified index.
 
int GetLocalElementsCount () const
 Get number of elements in local context.
 
bool InsertLocal (const KeyType &key, const ValueType &value)
 Insert element in local context.
 
void ResetLocal ()
 Removes all elements from local context.
 
void GetLocalKeys (Keys &result, bool doAppend=false) const
 Get list of local keys stored in this map.
 
virtual int GetElementsCount () const
 Get number of elements.
 
virtual ValueTypeoperator[] (const KeyType &key)
 Element access operator.
 
virtual const ValueTypeoperator[] (const KeyType &key) const
 Element access operator.
 
virtual int FindIndex (const KeyType &key) const
 Find index index of specified key.
 
virtual const ValueTypeFindElement (const KeyType &key) const
 Find value element associated with specified key.
 
virtual void GetKeys (Keys &result, bool doAppend=false) const
 Get list of keys stored in this map.
 
virtual const KeyTypeGetKeyAt (int index) const
 Get key value at specified index.
 
virtual const ValueTypeGetValueAt (int index) const
 Get mapped value at specified index.
 
- Public Member Functions inherited from istd::TIMap< Key, Value >

Additional Inherited Members

- Public Types inherited from istd::TIMap< Key, Value >
typedef Key KeyType
 
typedef Value ValueType
 
typedef QSet< KeyTypeKeys
 

Detailed Description

template<typename Key, typename Value>
class istd::TCascadedMap< Key, Value >

Helper class used to manage list of many connected in cascade maps.

Please note, that elements are accessed using its index. At this moment no element removing is supported. Local elements have begining indices.

Definition at line 29 of file TCascadedMap.h.

Constructor & Destructor Documentation

◆ TCascadedMap() [1/3]

template<typename Key , typename Value >
istd::TCascadedMap< Key, Value >::TCascadedMap ( )

Default constructor.

Definition at line 139 of file TCascadedMap.h.

◆ TCascadedMap() [2/3]

template<typename Key , typename Value >
istd::TCascadedMap< Key, Value >::TCascadedMap ( const TCascadedMap< Key, Value > * parentPtr)
explicit

Constructor with assigning of parent map.

Definition at line 146 of file TCascadedMap.h.

◆ TCascadedMap() [3/3]

template<typename Key , typename Value >
istd::TCascadedMap< Key, Value >::TCascadedMap ( const TCascadedMap< Key, Value > & map)

Copy constructor.

Definition at line 153 of file TCascadedMap.h.

Member Function Documentation

◆ FindElement()

template<typename Key , typename Value >
const TCascadedMap< Key, Value >::ValueType * istd::TCascadedMap< Key, Value >::FindElement ( const KeyType & key) const
virtual

Find value element associated with specified key.

Returns
pointer to associated value, or nullptr if key not exists.

Implements istd::TIMap< Key, Value >.

Definition at line 352 of file TCascadedMap.h.

◆ FindIndex()

template<typename Key , typename Value >
int istd::TCascadedMap< Key, Value >::FindIndex ( const KeyType & key) const
virtual

Find index index of specified key.

Implements istd::TIMap< Key, Value >.

Definition at line 333 of file TCascadedMap.h.

◆ FindLocalElement() [1/2]

template<typename Key , typename Value >
TCascadedMap< Key, Value >::ValueType * istd::TCascadedMap< Key, Value >::FindLocalElement ( const KeyType & key)

Find value element associated with specified key using local context only.

Returns
pointer to associated value, or nullptr if key not exists.

Definition at line 200 of file TCascadedMap.h.

◆ FindLocalElement() [2/2]

template<typename Key , typename Value >
const TCascadedMap< Key, Value >::ValueType * istd::TCascadedMap< Key, Value >::FindLocalElement ( const KeyType & key) const

Find value element associated with specified key using local context only.

Returns
pointer to associated value, or nullptr if key not exists.

Definition at line 188 of file TCascadedMap.h.

◆ FindLocalIndex()

template<typename Key , typename Value >
int istd::TCascadedMap< Key, Value >::FindLocalIndex ( const KeyType & key) const

Find index index of specified key using local context only.

Definition at line 176 of file TCascadedMap.h.

◆ GetElementsCount()

template<typename Key , typename Value >
int istd::TCascadedMap< Key, Value >::GetElementsCount ( ) const
virtual

Get number of elements.

Implements istd::TIMap< Key, Value >.

Definition at line 297 of file TCascadedMap.h.

◆ GetKeyAt()

template<typename Key , typename Value >
const TCascadedMap< Key, Value >::KeyType & istd::TCascadedMap< Key, Value >::GetKeyAt ( int index) const
virtual

Get key value at specified index.

Implements istd::TIMap< Key, Value >.

Definition at line 375 of file TCascadedMap.h.

◆ GetKeys()

template<typename Key , typename Value >
void istd::TCascadedMap< Key, Value >::GetKeys ( Keys & result,
bool doAppend = false ) const
virtual

Get list of keys stored in this map.

Parameters
doAppendif it is true, list of keys will be appended to existing key list.

Implements istd::TIMap< Key, Value >.

Definition at line 364 of file TCascadedMap.h.

◆ GetLocalElementsCount()

template<typename Key , typename Value >
int istd::TCascadedMap< Key, Value >::GetLocalElementsCount ( ) const

Get number of elements in local context.

Definition at line 248 of file TCascadedMap.h.

◆ GetLocalKeyAt() [1/2]

template<typename Key , typename Value >
TCascadedMap< Key, Value >::KeyType & istd::TCascadedMap< Key, Value >::GetLocalKeyAt ( int index)

Get key value from local context at specified index.

Definition at line 221 of file TCascadedMap.h.

◆ GetLocalKeyAt() [2/2]

template<typename Key , typename Value >
const TCascadedMap< Key, Value >::KeyType & istd::TCascadedMap< Key, Value >::GetLocalKeyAt ( int index) const

Get key value from local context at specified index.

Definition at line 212 of file TCascadedMap.h.

◆ GetLocalKeys()

template<typename Key , typename Value >
void istd::TCascadedMap< Key, Value >::GetLocalKeys ( Keys & result,
bool doAppend = false ) const

Get list of local keys stored in this map.

Parameters
doAppendif it is true, list of keys will be appended to existing key list.

Definition at line 280 of file TCascadedMap.h.

◆ GetLocalValueAt() [1/2]

template<typename Key , typename Value >
TCascadedMap< Key, Value >::ValueType & istd::TCascadedMap< Key, Value >::GetLocalValueAt ( int index)

Get mapped value from local context at specified index.

Definition at line 230 of file TCascadedMap.h.

◆ GetLocalValueAt() [2/2]

template<typename Key , typename Value >
const TCascadedMap< Key, Value >::ValueType & istd::TCascadedMap< Key, Value >::GetLocalValueAt ( int index) const

Get mapped value from local context at specified index.

Definition at line 239 of file TCascadedMap.h.

◆ GetParent()

template<typename Key , typename Value >
const TCascadedMap< Key, Value > * istd::TCascadedMap< Key, Value >::GetParent ( ) const

Get access to parent map instance.

Definition at line 162 of file TCascadedMap.h.

◆ GetValueAt()

template<typename Key , typename Value >
const TCascadedMap< Key, Value >::ValueType & istd::TCascadedMap< Key, Value >::GetValueAt ( int index) const
virtual

Get mapped value at specified index.

Implements istd::TIMap< Key, Value >.

Definition at line 389 of file TCascadedMap.h.

◆ InsertLocal()

template<typename Key , typename Value >
bool istd::TCascadedMap< Key, Value >::InsertLocal ( const KeyType & key,
const ValueType & value )

Insert element in local context.

Definition at line 255 of file TCascadedMap.h.

◆ operator[]() [1/2]

template<typename Key , typename Value >
TCascadedMap< Key, Value >::ValueType & istd::TCascadedMap< Key, Value >::operator[] ( const KeyType & key)
virtual

Element access operator.

If key object not exists, it will be automatically created.

Implements istd::TIMap< Key, Value >.

Definition at line 309 of file TCascadedMap.h.

◆ operator[]() [2/2]

template<typename Key , typename Value >
const TCascadedMap< Key, Value >::ValueType & istd::TCascadedMap< Key, Value >::operator[] ( const KeyType & key) const
virtual

Element access operator.

If key object not exists, it will be automatically created.

Implements istd::TIMap< Key, Value >.

Definition at line 326 of file TCascadedMap.h.

◆ ResetLocal()

template<typename Key , typename Value >
void istd::TCascadedMap< Key, Value >::ResetLocal ( )

Removes all elements from local context.

Definition at line 272 of file TCascadedMap.h.

◆ SetParent()

template<typename Key , typename Value >
void istd::TCascadedMap< Key, Value >::SetParent ( const TIMap< Key, Value > * parentPtr)

Set instance of parent map.

Definition at line 169 of file TCascadedMap.h.


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

© Witold Gantzke and Kirill Lepskiy