34#ifndef _UTILS_STLMAP_HXX_
35#define _UTILS_STLMAP_HXX_
49template <
typename Key,
typename Value>
class StlMap
84 typedef pair<Key, Value>
Pair;
87 typedef typename std::map<Key, Value>::iterator
Iterator;
121 return mapping ? (*mapping)[key] : (*mappingAllocator)[key];
This is a custom allocator that limits the number of mappings.
Though at the surface, this may seem like an unnecessary abstraction of std::map, it has the purpose ...
StlMap(size_t entries)
Constructor that limits the number of mappings to a static pool.
std::map< Key, Value > Mapping
short hand for the default allocator std::map type
Mapping * mapping
pointer to an std::map instance with a default allocator
MappingAllocator * mappingAllocator
pointer to an std::map instance with a custom allocator
std::map< Key, Value >::iterator Iterator
Short hand for the iterator type of a given instance.
size_t max_size()
Maximum theoretical number of elements in the map.
std::map< Key, Value, std::less< Key >, Allocator< std::pair< const Key, Value > > > MappingAllocator
short hand for the custom allocator std::map type
Value & operator[](const Key &key)
Find the index associated with the key and create it if does not exist.
Iterator end()
Get an iterator index pointing one past the last element in mapping.
void erase(Iterator it)
Remove a node from the tree.
StlMap()
Default Constructor which with no mapping entry limit.
size_t size()
Number of elements currently in the map.
void clear()
Removes all elements in the map.
size_t erase(Key key)
Remove an element from the tree.
Iterator begin()
Get an iterator index pointing one past the last element in mapping.
Iterator find(const Key &key)
Find an element matching the given key.
pair< Key, Value > Pair
This translation is done for consistency with SysMap and LinearMap.
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.