SUMO - Simulation of Urban MObility
StringBijection< T > Class Template Reference

#include <StringBijection.h>

Collaboration diagram for StringBijection< T >:
Collaboration graph

Data Structures

struct  Entry
 

Public Member Functions

void addAlias (const std::string str, const T key)
 
void addKeysInto (std::vector< T > &list) const
 
get (const std::string &str) const
 
const std::string & getString (const T key) const
 
std::vector< std::string > getStrings () const
 
bool has (const T key) const
 
bool hasString (const std::string &str) const
 
void insert (const std::string str, const T key, bool checkDuplicates=true)
 
void remove (const std::string str, const T key)
 
size_t size () const
 
 StringBijection ()
 
 StringBijection (Entry entries[], T terminatorKey, bool checkDuplicates=true)
 

Private Attributes

std::map< std::string, T > myString2T
 
std::map< T, std::string > myT2String
 

Detailed Description

template<class T>
class StringBijection< T >

Template container for maintaining a bidirectional map between strings and something else It is not always a bijection since it allows for duplicate entries on both sides if either checkDuplicates is set to false in the constructor or the insert function or if the addAlias function is used.

Definition at line 52 of file StringBijection.h.

Constructor & Destructor Documentation

template<class T>
StringBijection< T >::StringBijection ( )
inline

Definition at line 69 of file StringBijection.h.

template<class T>
StringBijection< T >::StringBijection ( Entry  entries[],
terminatorKey,
bool  checkDuplicates = true 
)
inline

Definition at line 72 of file StringBijection.h.

Member Function Documentation

template<class T>
void StringBijection< T >::addAlias ( const std::string  str,
const T  key 
)
inline
template<class T>
void StringBijection< T >::addKeysInto ( std::vector< T > &  list) const
inline

Definition at line 150 of file StringBijection.h.

template<class T>
bool StringBijection< T >::has ( const T  key) const
inline
template<class T>
void StringBijection< T >::remove ( const std::string  str,
const T  key 
)
inline

Definition at line 100 of file StringBijection.h.

Referenced by HelpersPHEMlight::getClassByName().

Field Documentation


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