Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
SequentialStringBijection Class Reference

#include <SequentialStringBijection.h>

Data Structures

struct  Entry
 

Public Member Functions

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

Private Attributes

std::map< std::string, int > myString2T
 
std::vector< std::string > myT2String
 

Detailed Description

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 39 of file SequentialStringBijection.h.

Constructor & Destructor Documentation

◆ SequentialStringBijection() [1/2]

SequentialStringBijection::SequentialStringBijection ( )
inline

Definition at line 56 of file SequentialStringBijection.h.

◆ SequentialStringBijection() [2/2]

SequentialStringBijection::SequentialStringBijection ( Entry  entries[],
int  terminatorKey,
bool  checkDuplicates = true 
)
inline

Definition at line 59 of file SequentialStringBijection.h.

References insert(), and myT2String.

Member Function Documentation

◆ addAlias()

void SequentialStringBijection::addAlias ( const std::string  str,
int  key 
)
inline

Definition at line 83 of file SequentialStringBijection.h.

References myString2T.

◆ addKeysInto()

void SequentialStringBijection::addKeysInto ( std::vector< int > &  list) const
inline

Definition at line 142 of file SequentialStringBijection.h.

References myString2T.

◆ get()

int SequentialStringBijection::get ( const std::string &  str) const
inline

Definition at line 94 of file SequentialStringBijection.h.

References hasString(), and myString2T.

Referenced by MSDevice_Emissions::initOnce(), MSDevice_FCD::initOnce(), MSMeanData::initWrittenAttributes(), and main().

Here is the caller graph for this function:

◆ getString()

const std::string & SequentialStringBijection::getString ( int  key) const
inline

Definition at line 103 of file SequentialStringBijection.h.

References myT2String.

Referenced by toString< SumoXMLAttr >(), and toString< SumoXMLTag >().

Here is the caller graph for this function:

◆ getStrings()

std::vector< std::string > SequentialStringBijection::getStrings ( ) const
inline

Definition at line 128 of file SequentialStringBijection.h.

References myT2String.

◆ getValues()

std::vector< int > SequentialStringBijection::getValues ( ) const
inline

Definition at line 133 of file SequentialStringBijection.h.

References myString2T.

◆ has()

bool SequentialStringBijection::has ( int  key) const
inline

Definition at line 118 of file SequentialStringBijection.h.

References myT2String.

Referenced by insert().

Here is the caller graph for this function:

◆ hasString()

bool SequentialStringBijection::hasString ( const std::string &  str) const
inline

Definition at line 113 of file SequentialStringBijection.h.

References myString2T.

Referenced by get(), and insert().

Here is the caller graph for this function:

◆ insert()

void SequentialStringBijection::insert ( const std::string  str,
int  key,
bool  checkDuplicates = true 
)
inline

Definition at line 68 of file SequentialStringBijection.h.

References has(), hasString(), myString2T, and myT2String.

Referenced by SequentialStringBijection().

Here is the caller graph for this function:

◆ remove()

void SequentialStringBijection::remove ( const std::string  str,
int  key 
)
inline

Definition at line 88 of file SequentialStringBijection.h.

References myString2T, and myT2String.

◆ size()

int SequentialStringBijection::size ( ) const
inline

Definition at line 123 of file SequentialStringBijection.h.

References myString2T.

Field Documentation

◆ myString2T

std::map<std::string, int> SequentialStringBijection::myString2T
private

◆ myT2String

std::vector<std::string> SequentialStringBijection::myT2String
private

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