Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
StringBijection< T > Class Template Reference

#include <StringBijection.h>

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
 
std::vector< T > getValues () 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 41 of file StringBijection.h.

Constructor & Destructor Documentation

◆ StringBijection() [1/2]

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

Definition at line 58 of file StringBijection.h.

◆ StringBijection() [2/2]

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

Definition at line 61 of file StringBijection.h.

References StringBijection< T >::insert().

Member Function Documentation

◆ addAlias()

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

Definition at line 84 of file StringBijection.h.

References StringBijection< T >::myString2T.

Referenced by HelpersPHEMlight::getClassByName(), HelpersPHEMlight5::getClassByName(), PollutantsInterface::Helper::Helper(), HelpersHBEFA::HelpersHBEFA(), HelpersHBEFA3::HelpersHBEFA3(), and HelpersHBEFA4::HelpersHBEFA4().

Here is the caller graph for this function:

◆ addKeysInto()

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

Definition at line 147 of file StringBijection.h.

References StringBijection< T >::myT2String.

◆ get()

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

Definition at line 95 of file StringBijection.h.

References StringBijection< T >::hasString(), and StringBijection< T >::myString2T.

Referenced by NIImporter_SUMO::addConnection(), NIImporter_SUMO::addEdge(), NIXMLEdgesHandler::addEdge(), NBNodeCont::analyzeCluster(), NBNetBuilder::applyOptions(), SUMOVehicleParserHelper::beginVTypeParsing(), NIVisumTL::build(), NGNode::buildNBNode(), NBNetBuilder::compute(), NBOwnTLDef::computeLogicAndConts(), NBTrafficLightLogicCont::computeLogics(), SUMOSAXAttributes::fromString(), HelpersHBEFA3::getClass(), HelpersHBEFA4::getClass(), HelpersPHEMlight::getClass(), HelpersPHEMlight::getClassByName(), HelpersPHEMlight5::getClassByName(), PHEMCEP::GetEmission(), NWWriter_OpenDrive::getID(), GNEInternalLane::getPopUpMenu(), GNELane::getPopUpMenu(), NIImporter_OpenDrive::getTLSSecure(), GNEChange_TLS::GNEChange_TLS(), NBNodeCont::guessTLs(), HelpersHBEFA::HelpersHBEFA(), HelpersHBEFA3::HelpersHBEFA3(), HelpersHBEFA4::HelpersHBEFA4(), NLHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_OpenStreetMap::insertNodeChecking(), MSDispatch_TraCI::interpretDispatch(), NBNodeCont::joinNodeCluster(), NIImporter_VISUM::loadLanguage(), PCLoaderVisum::loadLanguage(), NIXMLTypesHandler::myStartElement(), RONetHandler::parseConnection(), NLHandler::parseLinkDir(), NLHandler::parseLinkState(), NIXMLNodesHandler::processNodeType(), NIXMLNodesHandler::processTrafficLightDefinitions(), MSDispatch_TraCI::removeReservation(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), GNEVType::setAttribute(), GNEEdgeType::setAttribute(), GNEJunction::setAttribute(), PointOfInterest::setIcon(), MSDispatch_TraCI::splitReservation(), SUMOVTypeParameter::SUMOVTypeParameter(), NIXMLEdgesHandler::tryGetLaneSpread(), NBNodeTypeComputer::validateRailCrossings(), NWWriter_XML::writeEdgesAndConnections(), and NWWriter_XML::writeNodes().

◆ getString()

template<class T >
const std::string & StringBijection< T >::getString ( const T  key) const
inline

Definition at line 104 of file StringBijection.h.

References StringBijection< T >::has(), and StringBijection< T >::myT2String.

Referenced by GUIGlObject::createFullName(), HelpersHBEFA3::getAmitranVehicleClass(), HelpersHBEFA4::getAmitranVehicleClass(), HelpersPHEMlight::getAmitranVehicleClass(), GNEVType::getAttribute(), GNEEdge::getAttribute(), GNEEdgeType::getAttribute(), GNEJunction::getAttribute(), HelpersHBEFA3::getEuroClass(), HelpersHBEFA4::getEuroClass(), HelpersPHEMlight::getEuroClass(), HelpersHBEFA3::getFuel(), HelpersHBEFA4::getFuel(), HelpersPHEMlight::getFuel(), HelpersPHEMlight5::getFuel(), PointOfInterest::getIconStr(), SUMOVehicleParameter::getInsertionChecks(), LIBSUMO_NAMESPACE::Lane::getLinks(), LIBSUMO_NAMESPACE::Vehicle::getNextLinks(), NIImporter_VISUM::getPermissions(), HelpersPHEMlight::getWeight(), PCLoaderVisum::load(), GNESelectorFrame::SelectionOperation::loadFromFile(), NIImporter_VISUM::NIImporter_VISUM(), GNESelectorFrame::SelectionOperation::onCmdSave(), NIImporter_VISUM::parse_AreaSubPartElement(), NIImporter_VISUM::parse_Connectors(), NIImporter_VISUM::parse_Connectors_legacy(), NIImporter_VISUM::parse_Districts(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_Kante(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_Nodes(), NIImporter_VISUM::parse_PartOfArea(), NIImporter_VISUM::parse_Phases(), NIImporter_VISUM::parse_Point(), NIImporter_VISUM::parse_SignalGroups(), NIImporter_VISUM::parse_stopPoints(), NIImporter_VISUM::parse_TrafficLights(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_Types(), NIImporter_VISUM::parse_VSysTypes(), AdditionalHandler::parsePOIAttributes(), toString< FringeType >(), toString< InsertionCheck >(), toString< LaneChangeModel >(), toString< LaneSpreadFunction >(), toString< LinkDirection >(), toString< LinkState >(), toString< ParkingType >(), toString< PersonMode >(), toString< RightOfWay >(), toString< SumoXMLEdgeFunc >(), toString< SumoXMLNodeType >(), toString< TrafficLightLayout >(), toString< TrafficLightType >(), NBSign::writeAsPOI(), MSDriveWay::writeBlockVehicles(), GNEDetector::writeDetectorValues(), and NIImporter_OpenDrive::writeRoadObjects().

◆ getStrings()

template<class T >
std::vector< std::string > StringBijection< T >::getStrings ( ) const
inline

Definition at line 129 of file StringBijection.h.

References StringBijection< T >::myT2String.

Referenced by GNEVehicleTypeDialog::CarFollowingModelParameters::CarFollowingModelParameters(), GNEAttributeCarrier::fillNetworkElements(), GNEInternalLane::getPopUpMenu(), GNELane::getPopUpMenu(), and toString< LaneChangeAction >().

Here is the caller graph for this function:

◆ getValues()

template<class T >
std::vector< T > StringBijection< T >::getValues ( ) const
inline

Definition at line 138 of file StringBijection.h.

References StringBijection< T >::myT2String.

Referenced by SUMOVehicleParameter::getInsertionChecks(), GNEAttributesCreatorRow::refreshRow(), GNEAttributesEditorRow::showValueComboBox(), and SUMOVehicleParameter::write().

Here is the caller graph for this function:

◆ has()

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

Definition at line 119 of file StringBijection.h.

References StringBijection< T >::myT2String.

Referenced by MSDispatch_TraCI::addReservation(), StringBijection< T >::getString(), and StringBijection< T >::insert().

Here is the caller graph for this function:

◆ hasString()

◆ insert()

◆ remove()

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

Definition at line 89 of file StringBijection.h.

References StringBijection< T >::myString2T, and StringBijection< T >::myT2String.

Referenced by MSDispatch_TraCI::fulfilledReservation(), HelpersPHEMlight::getClassByName(), NIImporter_VISUM::loadLanguage(), PCLoaderVisum::loadLanguage(), and MSDispatch_TraCI::removeReservation().

Here is the caller graph for this function:

◆ size()

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

Definition at line 124 of file StringBijection.h.

References StringBijection< T >::myString2T.

Field Documentation

◆ myString2T

◆ myT2String


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