|
Open Model Railroad Network (OpenMRN)
|
Though at the surface, this may seem like an unnecessary abstraction of std::map, it has the purpose of limiting the implementation to features found only in common to SysMap and LinearMap implementations. More...
#include <StlMap.hxx>
Public Types | |
| typedef pair< Key, Value > | Pair |
| This translation is done for consistency with SysMap and LinearMap. | |
| typedef std::map< Key, Value >::iterator | Iterator |
| Short hand for the iterator type of a given instance. | |
Public Member Functions | |
| StlMap () | |
| Default Constructor which with no mapping entry limit. | |
| StlMap (size_t entries) | |
| Constructor that limits the number of mappings to a static pool. | |
| ~StlMap () | |
| Destructor. | |
| void | clear () |
| Removes all elements in the map. | |
| size_t | erase (Key key) |
| Remove an element from the tree. | |
| void | erase (Iterator it) |
| Remove a node from the tree. | |
| Value & | operator[] (const Key &key) |
| Find the index associated with the key and create it if does not exist. | |
| size_t | size () |
| Number of elements currently in the map. | |
| size_t | max_size () |
| Maximum theoretical number of elements in the map. | |
| Iterator | find (const Key &key) |
| Find an element matching the given key. | |
| Iterator | end () |
| Get an iterator index pointing one past the last element in mapping. | |
| Iterator | begin () |
| Get an iterator index pointing one past the last element in mapping. | |
Private Types | |
| typedef std::map< Key, Value, std::less< Key >, Allocator< std::pair< const Key, Value > > > | MappingAllocator |
| short hand for the custom allocator std::map type | |
| typedef std::map< Key, Value > | Mapping |
| short hand for the default allocator std::map type | |
Private Member Functions | |
| DISALLOW_COPY_AND_ASSIGN (StlMap) | |
Private Attributes | |
| MappingAllocator * | mappingAllocator |
| pointer to an std::map instance with a custom allocator | |
| Mapping * | mapping |
| pointer to an std::map instance with a default allocator | |
Though at the surface, this may seem like an unnecessary abstraction of std::map, it has the purpose of limiting the implementation to features found only in common to SysMap and LinearMap implementations.
In this way, one can use Map and based on compile time settings choose to use any one of StlMap, SysMap, or LinearMap from the same source usage of Map.
Definition at line 49 of file StlMap.hxx.
| typedef std::map<Key,Value>::iterator StlMap< Key, Value >::Iterator |
Short hand for the iterator type of a given instance.
Definition at line 87 of file StlMap.hxx.
|
private |
short hand for the default allocator std::map type
Definition at line 170 of file StlMap.hxx.
|
private |
short hand for the custom allocator std::map type
Definition at line 167 of file StlMap.hxx.
| typedef pair<Key, Value> StlMap< Key, Value >::Pair |
This translation is done for consistency with SysMap and LinearMap.
Definition at line 84 of file StlMap.hxx.
Default Constructor which with no mapping entry limit.
Definition at line 54 of file StlMap.hxx.
Constructor that limits the number of mappings to a static pool.
| entries | number of nodes to statically create and track |
Definition at line 63 of file StlMap.hxx.
Destructor.
Definition at line 71 of file StlMap.hxx.
Get an iterator index pointing one past the last element in mapping.
Definition at line 160 of file StlMap.hxx.
|
inline |
Removes all elements in the map.
Definition at line 90 of file StlMap.hxx.
Get an iterator index pointing one past the last element in mapping.
Definition at line 152 of file StlMap.hxx.
Remove a node from the tree.
| it | iterator index for the element to remove |
Definition at line 110 of file StlMap.hxx.
|
inline |
Remove an element from the tree.
| key | key for the element to remove |
Definition at line 102 of file StlMap.hxx.
|
inline |
Find an element matching the given key.
| key | key to search for |
Definition at line 144 of file StlMap.hxx.
|
inline |
Maximum theoretical number of elements in the map.
Definition at line 135 of file StlMap.hxx.
|
inline |
Find the index associated with the key and create it if does not exist.
| key | key to lookup |
Definition at line 119 of file StlMap.hxx.
|
inline |
Number of elements currently in the map.
Definition at line 127 of file StlMap.hxx.
pointer to an std::map instance with a default allocator
Definition at line 176 of file StlMap.hxx.
|
private |
pointer to an std::map instance with a custom allocator
Definition at line 173 of file StlMap.hxx.