Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Map< Key, Value > Class Template Reference

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>

Inheritance diagram for Map< Key, Value >:

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)
 

Detailed Description

template<typename Key, typename Value>
class Map< Key, Value >

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.

Definition at line 62 of file Map.hxx.

Constructor & Destructor Documentation

◆ Map() [1/2]

template<typename Key , typename Value >
Map< Key, Value >::Map ( )
inline

Default Constructor which with no mapping entry limit.

Definition at line 67 of file Map.hxx.

◆ Map() [2/2]

template<typename Key , typename Value >
Map< Key, Value >::Map ( size_t  entries)
inline

Constructor that limits the number of mappings to a static pool.

Parameters
entriesnumber of nodes to statically create and track

Definition at line 75 of file Map.hxx.

◆ ~Map()

template<typename Key , typename Value >
Map< Key, Value >::~Map ( )
inline

Destructor.

Definition at line 82 of file Map.hxx.


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