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)
 
int 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 45 of file StringBijection.h.

Constructor & Destructor Documentation

◆ StringBijection() [1/2]

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

Definition at line 62 of file StringBijection.h.

◆ StringBijection() [2/2]

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

Definition at line 65 of file StringBijection.h.

Member Function Documentation

◆ addAlias()

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

◆ addKeysInto()

template<class T>
void StringBijection< T >::addKeysInto ( std::vector< T > &  list) const
inline

Definition at line 143 of file StringBijection.h.

◆ get()

template<class T>
T StringBijection< T >::get ( const std::string &  str) const
inline

Definition at line 99 of file StringBijection.h.

Referenced by NIImporter_SUMO::addConnection(), NIImporter_SUMO::addEdge(), NBNodeCont::analyzeCluster(), SUMOVehicleParserHelper::beginVTypeParsing(), NIVisumTL::build(), NGNode::buildNBNode(), NBNetBuilder::compute(), HelpersHBEFA3::getClass(), HelpersPHEMlight::getClass(), HelpersPHEMlight::getClassByName(), SUMOSAXAttributesImpl_Cached::getEdgeFunc(), SUMOSAXAttributesImpl_Xerces::getEdgeFunc(), PHEMCEP::GetEmission(), NWWriter_OpenDrive::getID(), SUMOSAXAttributesImpl_Cached::getNodeType(), SUMOSAXAttributesImpl_Xerces::getNodeType(), GNEInternalLane::getPopUpMenu(), GNELane::getPopUpMenu(), SUMOSAXAttributesImpl_Cached::getRightOfWay(), SUMOSAXAttributesImpl_Xerces::getRightOfWay(), SUMOSAXAttributesImpl_Binary::getRightOfWay(), getVehicleClassCompoundID(), getVehicleClassID(), getVehicleClassNamesList(), getVehicleShapeID(), NBNodeCont::guessTLs(), HelpersHBEFA::HelpersHBEFA(), HelpersHBEFA3::HelpersHBEFA3(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NLHandler::initTrafficLightLogic(), NIImporter_OpenStreetMap::insertNodeChecking(), NIImporter_OpenDrive::loadNetwork(), NLHandler::parseLinkDir(), NLHandler::parseLinkState(), NIXMLNodesHandler::processNodeType(), NIXMLNodesHandler::processTrafficLightDefinitions(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), GNEJunction::setAttribute(), SUMOVTypeParameter::SUMOVTypeParameter(), NIXMLEdgesHandler::tryGetLaneSpread(), and NBNodeTypeComputer::validateRailCrossings().

◆ getString()

◆ getStrings()

◆ has()

template<class T>
bool StringBijection< T >::has ( const T  key) const
inline

◆ hasString()

◆ insert()

◆ remove()

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

Definition at line 93 of file StringBijection.h.

Referenced by HelpersPHEMlight::getClassByName().

◆ size()

template<class T>
int StringBijection< T >::size ( ) const
inline

Field Documentation

◆ myString2T

◆ myT2String


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