MongoType
MongoDB Collection Data Dump with BSON Types
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mongotype::EnumMapper< E > Class Template Reference

#include <Parameters.hpp>

Details:

template<class E>
class mongotype::EnumMapper< E >

Map enumeration integers to their string equivalents.

Definition at line 68 of file Parameters.hpp.

Collaboration diagram for mongotype::EnumMapper< E >:

Public Member Functions

 EnumMapper ()
 
void insert (const char *key, E value)
 
find (string &s, E defValue)
 

Private Types

typedef map< string, E > EnumMap
 
typedef EnumMap::value_type EnumMapValue
 

Private Attributes

EnumMap enumMap
 

Member Typedef Documentation

template<class E >
typedef map<string, E> mongotype::EnumMapper< E >::EnumMap
private

Definition at line 69 of file Parameters.hpp.

template<class E >
typedef EnumMap::value_type mongotype::EnumMapper< E >::EnumMapValue
private

Definition at line 70 of file Parameters.hpp.

Constructor & Destructor Documentation

template<class E >
mongotype::EnumMapper< E >::EnumMapper ( )
inline

Definition at line 75 of file Parameters.hpp.

Member Function Documentation

template<class E >
E mongotype::EnumMapper< E >::find ( string &  s,
defValue 
)
inline

Look up the enumeration value corresponding to the input string in the associative array. and return its enumeration value, or the default value if it is not found.

Parameters
[in]sThe key string.
[in]defValueThe default enumeration value.
Returns
The enumeration value if the string is found, or the default value if it is not found.

Definition at line 88 of file Parameters.hpp.

References mongotype::EnumMapper< E >::enumMap.

template<class E >
void mongotype::EnumMapper< E >::insert ( const char *  key,
value 
)
inline

Insert an string key and its corresponding enumeration value to the internal associative array.

Parameters
[in]keyThe key string.
[in]valueThe enumeration value.

Definition at line 81 of file Parameters.hpp.

References mongotype::EnumMapper< E >::enumMap.

Member Data Documentation

template<class E >
EnumMap mongotype::EnumMapper< E >::enumMap
private

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