Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

DataStructures::Map< key_type, data_type, key_comparison_func > Class Template Reference

#include <DS_Map.h>

Collaboration diagram for DataStructures::Map< key_type, data_type, key_comparison_func >:
Collaboration graph
[legend]

List of all members.

Classes

struct  MapNode

Public Member Functions

 Map ()
 ~Map ()
 Map (const Map &original_copy)
Mapoperator= (const Map &original_copy)
data_type & Get (const key_type &key) const
data_type Pop (const key_type &key)
void Set (const key_type &key, const data_type &data)
void SetExisting (const key_type &key, const data_type &data)
void SetNew (const key_type &key, const data_type &data)
bool Has (const key_type &key) const
bool Delete (const key_type &key)
data_type & operator[] (const unsigned int position) const
key_type GetKeyAtIndex (const unsigned int position) const
unsigned GetIndexAtKey (const key_type &key)
void RemoveAtIndex (const unsigned index)
void Clear (void)
unsigned Size (void) const

Static Public Member Functions

static void IMPLEMENT_DEFAULT_COMPARISON (void)
static int NodeComparisonFunc (const key_type &a, const MapNode &b)

Protected Member Functions

void SaveLastSearch (const key_type &key, unsigned index) const
bool HasSavedSearchResult (const key_type &key) const

Protected Attributes

DataStructures::OrderedList
< key_type, MapNode,&Map::NodeComparisonFunc > 
mapNodeList
unsigned lastSearchIndex
key_type lastSearchKey
bool lastSearchIndexValid

Detailed Description

template<class key_type, class data_type, int(*)(const key_type &, const key_type &) key_comparison_func = defaultMapKeyComparison<key_type>>
class DataStructures::Map< key_type, data_type, key_comparison_func >

Note:
IMPORTANT! If you use defaultMapKeyComparison then call IMPLEMENT_DEFAULT_COMPARISON or you will get an unresolved external linker error.

Definition at line 35 of file DS_Map.h.


Constructor & Destructor Documentation

template<class key_type , class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
DataStructures::Map< key_type, data_type, key_comparison_func >::Map (  ) 

Definition at line 93 of file DS_Map.h.

template<class key_type , class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
DataStructures::Map< key_type, data_type, key_comparison_func >::~Map (  ) 

Definition at line 99 of file DS_Map.h.

Here is the call graph for this function:

template<class key_type , class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
DataStructures::Map< key_type, data_type, key_comparison_func >::Map ( const Map< key_type, data_type, key_comparison_func > &  original_copy  ) 

Definition at line 105 of file DS_Map.h.


Member Function Documentation

template<class key_type , class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
void DataStructures::Map< key_type, data_type, key_comparison_func >::Clear ( void   ) 

Definition at line 273 of file DS_Map.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class key_type, class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
bool DataStructures::Map< key_type, data_type, key_comparison_func >::Delete ( const key_type &  key  ) 

Definition at line 250 of file DS_Map.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class key_type, class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
data_type & DataStructures::Map< key_type, data_type, key_comparison_func >::Get ( const key_type &  key  )  const

Definition at line 124 of file DS_Map.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class key_type, class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
unsigned DataStructures::Map< key_type, data_type, key_comparison_func >::GetIndexAtKey ( const key_type &  key  ) 

Definition at line 138 of file DS_Map.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class key_type , class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
key_type DataStructures::Map< key_type, data_type, key_comparison_func >::GetKeyAtIndex ( const unsigned int  position  )  const

Definition at line 286 of file DS_Map.h.

Here is the caller graph for this function:

template<class key_type, class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
bool DataStructures::Map< key_type, data_type, key_comparison_func >::Has ( const key_type &  key  )  const

Definition at line 236 of file DS_Map.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class key_type, class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
bool DataStructures::Map< key_type, data_type, key_comparison_func >::HasSavedSearchResult ( const key_type &  key  )  const [protected]

Definition at line 311 of file DS_Map.h.

Here is the caller graph for this function:

template<class key_type, class data_type, int(*)(const key_type &, const key_type &) key_comparison_func = defaultMapKeyComparison<key_type>>
static void DataStructures::Map< key_type, data_type, key_comparison_func >::IMPLEMENT_DEFAULT_COMPARISON ( void   )  [inline, static]

Definition at line 38 of file DS_Map.h.

template<class key_type, class data_type, int(*)(const key_type &, const key_type &) key_comparison_func = defaultMapKeyComparison<key_type>>
static int DataStructures::Map< key_type, data_type, key_comparison_func >::NodeComparisonFunc ( const key_type &  a,
const MapNode b 
) [inline, static]

Definition at line 51 of file DS_Map.h.

template<class key_type , class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
Map< key_type, data_type, key_comparison_func > & DataStructures::Map< key_type, data_type, key_comparison_func >::operator= ( const Map< key_type, data_type, key_comparison_func > &  original_copy  ) 

Definition at line 114 of file DS_Map.h.

template<class key_type , class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
data_type & DataStructures::Map< key_type, data_type, key_comparison_func >::operator[] ( const unsigned int  position  )  const

Definition at line 280 of file DS_Map.h.

template<class key_type, class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
data_type DataStructures::Map< key_type, data_type, key_comparison_func >::Pop ( const key_type &  key  ) 

Definition at line 162 of file DS_Map.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class key_type , class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
void DataStructures::Map< key_type, data_type, key_comparison_func >::RemoveAtIndex ( const unsigned  index  ) 

Definition at line 155 of file DS_Map.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class key_type, class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
void DataStructures::Map< key_type, data_type, key_comparison_func >::SaveLastSearch ( const key_type &  key,
unsigned  index 
) const [protected]

Definition at line 298 of file DS_Map.h.

Here is the caller graph for this function:

template<class key_type, class data_type, int(*)(const key_type &, const key_type &) key_comparison_func>
void DataStructures::Map< key_type, data_type, key_comparison_func >::Set ( const key_type &  key,
const data_type &  data 
)

Definition at line 180 of file DS_Map.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class key_type, class data_type, int(*)(const key_type &, const key_type &) key_comparison_func>
void DataStructures::Map< key_type, data_type, key_comparison_func >::SetExisting ( const key_type &  key,
const data_type &  data 
)

Definition at line 205 of file DS_Map.h.

Here is the call graph for this function:

template<class key_type, class data_type, int(*)(const key_type &, const key_type &) key_comparison_func>
void DataStructures::Map< key_type, data_type, key_comparison_func >::SetNew ( const key_type &  key,
const data_type &  data 
)

Definition at line 225 of file DS_Map.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class key_type , class data_type , int(*)(const key_type &, const key_type &) key_comparison_func>
unsigned DataStructures::Map< key_type, data_type, key_comparison_func >::Size ( void   )  const

Definition at line 292 of file DS_Map.h.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

template<class key_type, class data_type, int(*)(const key_type &, const key_type &) key_comparison_func = defaultMapKeyComparison<key_type>>
unsigned DataStructures::Map< key_type, data_type, key_comparison_func >::lastSearchIndex [protected]

Definition at line 87 of file DS_Map.h.

template<class key_type, class data_type, int(*)(const key_type &, const key_type &) key_comparison_func = defaultMapKeyComparison<key_type>>
bool DataStructures::Map< key_type, data_type, key_comparison_func >::lastSearchIndexValid [protected]

Definition at line 89 of file DS_Map.h.

template<class key_type, class data_type, int(*)(const key_type &, const key_type &) key_comparison_func = defaultMapKeyComparison<key_type>>
key_type DataStructures::Map< key_type, data_type, key_comparison_func >::lastSearchKey [protected]

Definition at line 88 of file DS_Map.h.

template<class key_type, class data_type, int(*)(const key_type &, const key_type &) key_comparison_func = defaultMapKeyComparison<key_type>>
DataStructures::OrderedList< key_type,MapNode,&Map::NodeComparisonFunc > DataStructures::Map< key_type, data_type, key_comparison_func >::mapNodeList [protected]

Definition at line 82 of file DS_Map.h.


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