|
Open Model Railroad Network (OpenMRN)
|
Though the standard template library includes std::map, commonly implemented as a Red Black tree, this alternative provides a transparent mechanism for the user to at compile time decide between an implementation that uses StlMap based on std::map, SysMap based on BSD sys/tree.h, or LinearMap based on a small linear search. More...
#include <Map.hxx>
Public Member Functions | |
| Map () | |
| Default Constructor which with no mapping entry limit. | |
| Map (size_t entries) | |
| Constructor that limits the number of mappings to a static pool. | |
| ~Map () | |
| Destructor. | |
Private Member Functions | |
| DISALLOW_COPY_AND_ASSIGN (Map) | |
Though the standard template library includes std::map, commonly implemented as a Red Black tree, this alternative provides a transparent mechanism for the user to at compile time decide between an implementation that uses StlMap based on std::map, SysMap based on BSD sys/tree.h, or LinearMap based on a small linear search.
If LINEAR_MAP is defined, LinearMap will be used, else if USE_LIBSTDCPP is defined, StlMap will be used, else if neither is defined, SysMap will be used. Given that this is a header only implementation, a clever developer could define or undefine USE_LIBSTDCPP and/or LENEAR_MAP ahead of a #include "utils/Map.hxx" to override any compiler flag settings.