Implementation of simple mapping class. More...
#include <smallmap_type.hpp>
Public Types | |
| typedef ::SmallPair< T, U > | Pair |
| typedef Pair * | iterator |
| typedef const Pair * | const_iterator |
Public Member Functions | |
| FORCEINLINE | SmallMap () |
| Creates new SmallMap. | |
| FORCEINLINE | ~SmallMap () |
| Data are freed in SmallVector destructor. | |
| FORCEINLINE Pair * | Find (const T &key) |
| Finds given key in this map. | |
| FORCEINLINE void | Erase (Pair *pair) |
| Removes given pair from this map. | |
| FORCEINLINE bool | Erase (const T &key) |
| Removes given key from this map. | |
| FORCEINLINE bool | Insert (const T &key, const U &data) |
| Adds new item to this map. | |
| FORCEINLINE U & | operator[] (const T &key) |
| Returns data belonging to this key. | |
| FORCEINLINE void | SortByKey () |
Static Public Member Functions | |
| static int CDECL | KeySorter (const Pair *a, const Pair *b) |
Implementation of simple mapping class.
Both types have to be POD ("Plain Old Data")! It has inherited accessors from SmallVector().
Definition at line 33 of file smallmap_type.hpp.
| FORCEINLINE SmallMap< T, U, S >::SmallMap | ( | ) | [inline] |
Creates new SmallMap.
Data are initialized in SmallVector constructor
Definition at line 39 of file smallmap_type.hpp.
| FORCEINLINE bool SmallMap< T, U, S >::Erase | ( | const T & | key | ) | [inline] |
Removes given key from this map.
| key | key to remove |
Definition at line 70 of file smallmap_type.hpp.
| FORCEINLINE void SmallMap< T, U, S >::Erase | ( | Pair * | pair | ) | [inline] |
Removes given pair from this map.
| pair | pair to remove |
Definition at line 59 of file smallmap_type.hpp.
| FORCEINLINE Pair* SmallMap< T, U, S >::Find | ( | const T & | key | ) | [inline] |
Finds given key in this map.
| key | key to find |
Definition at line 47 of file smallmap_type.hpp.
Referenced by AIInfo::AddLabels(), SmallMap< NetworkAddress, SOCKET, 4 >::Insert(), and NetworkAddress::Resolve().
| FORCEINLINE bool SmallMap< T, U, S >::Insert | ( | const T & | key, | |
| const U & | data | |||
| ) | [inline] |
Adds new item to this map.
| key | key | |
| data | data |
Definition at line 86 of file smallmap_type.hpp.
Referenced by AIInfo::AddLabels().
| FORCEINLINE U& SmallMap< T, U, S >::operator[] | ( | const T & | key | ) | [inline] |
Returns data belonging to this key.
| key | key |
Definition at line 98 of file smallmap_type.hpp.
1.6.1