Public Member Functions | List of all members
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 >:
istd::TIMap< Key, Value > istd::IPolymorphic

Public Member Functions

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

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 25 of file TCascadedMap.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 135 of file TCascadedMap.h.

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 142 of file TCascadedMap.h.

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

Copy constructor.

Definition at line 149 of file TCascadedMap.h.

Member Function Documentation

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 NULL if key not exists.

Implements istd::TIMap< Key, Value >.

Definition at line 348 of file TCascadedMap.h.

References NULL.

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 329 of file TCascadedMap.h.

References NULL.

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 NULL if key not exists.

Definition at line 184 of file TCascadedMap.h.

References NULL.

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 NULL if key not exists.

Definition at line 196 of file TCascadedMap.h.

References NULL.

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 172 of file TCascadedMap.h.

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 293 of file TCascadedMap.h.

References NULL.

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 371 of file TCascadedMap.h.

References NULL.

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 360 of file TCascadedMap.h.

References NULL.

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

Get number of elements in local context.

Definition at line 244 of file TCascadedMap.h.

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 208 of file TCascadedMap.h.

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 217 of file TCascadedMap.h.

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 276 of file TCascadedMap.h.

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 235 of file TCascadedMap.h.

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 226 of file TCascadedMap.h.

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

Get access to parent map instance.

Definition at line 158 of file TCascadedMap.h.

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 385 of file TCascadedMap.h.

References NULL.

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 251 of file TCascadedMap.h.

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 305 of file TCascadedMap.h.

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 322 of file TCascadedMap.h.

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

Removes all elements from local context.

Definition at line 268 of file TCascadedMap.h.

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

Set instance of parent map.

Definition at line 165 of file TCascadedMap.h.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy