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

#include <StringBijection.h>

Data Structures

struct  Entry
 bijection entry More...
 

Public Member Functions

void addAlias (const std::string str, const T key)
 add alias to the given key
 
void addKeysInto (std::vector< T > &list) const
 add the given list of keys
 
get (const std::string &str) const
 get key
 
std::string getMultilineString () const
 get multiline string (all strings concatenated and separated by '
')
 
const std::string & getString (const T key) const
 get string
 
std::vector< std::string > getStrings () const
 get all strings
 
std::vector< T > getValues () const
 get all keys
 
bool has (const T key) const
 check if the given key exist
 
bool hasString (const std::string &str) const
 check if the given string exist
 
void insert (const std::string str, const T key, bool checkDuplicates=true)
 insert string and their associated key
 
void remove (const std::string str, const T key)
 remove string
 
int size () const
 get number of key-attributes
 
 StringBijection ()
 default constructor
 
 StringBijection (Entry entries[], T terminatorKey, bool checkDuplicates=true)
 parameter constructor
 

Private Attributes

std::map< std::string, T > myString2T
 map with the keys vinculated with strings
 
std::map< T, std::string > myT2String
 map with the strings vinculated with keys
 

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 40 of file StringBijection.h.

Constructor & Destructor Documentation

◆ StringBijection() [1/2]

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

default constructor

Definition at line 58 of file StringBijection.h.

◆ StringBijection() [2/2]

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

parameter constructor

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

add alias to the given key

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

add the given list of keys

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

get key

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(), GNEStoppingPlace::setStoppingPlaceAttribute(), MSDispatch_TraCI::splitReservation(), SUMOVTypeParameter::SUMOVTypeParameter(), NIXMLEdgesHandler::tryGetLaneSpread(), NBNodeTypeComputer::validateRailCrossings(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeNetwork(), and NWWriter_XML::writeNodes().

◆ getMultilineString()

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

get multiline string (all strings concatenated and separated by '
')

Note
this will be removed after unifying all FXFileDialog

Definition at line 156 of file StringBijection.h.

References StringBijection< T >::myT2String.

◆ getString()

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

get string

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(), GNEStoppingPlace::getStoppingPlaceAttribute(), 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::parseChargingStationAttributes(), MeanDataHandler::parseEdgeMeanData(), MeanDataHandler::parseLaneMeanData(), AdditionalHandler::parsePOIAttributes(), GNEMeanData::setAttribute(), 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(), GNEMeanData::writeMeanData(), and NIImporter_OpenDrive::writeRoadObjects().

◆ getStrings()

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

get all strings

Definition at line 129 of file StringBijection.h.

References StringBijection< T >::myT2String.

Referenced by GNEVehicleTypeDialog::CarFollowingModelParameters::CarFollowingModelParameters(), GNETagPropertiesDatabase::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

get all keys

Definition at line 138 of file StringBijection.h.

References StringBijection< T >::myT2String.

Referenced by SUMOVehicleParameter::getInsertionChecks(), 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

check if the given key exist

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()

template<class T >
void StringBijection< T >::insert ( const std::string  str,
const T  key,
bool  checkDuplicates = true 
)
inline

◆ remove()

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

remove string

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

get number of key-attributes

Definition at line 124 of file StringBijection.h.

References StringBijection< T >::myString2T.

Referenced by MSDispatch_TraCI::fulfilledReservation().

Here is the caller graph for this function:

Field Documentation

◆ myString2T

template<class T >
std::map<std::string, T> StringBijection< T >::myString2T
private

◆ myT2String


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