![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#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 | |
| T | 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 | |
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.
|
inline |
default constructor
Definition at line 58 of file StringBijection.h.
|
inline |
|
inline |
|
inline |
|
inline |
get key
Definition at line 95 of file StringBijection.h.
References hasString(), and myString2T.
Referenced by NWWriter_OpenDrive::getID().
|
inline |
get multiline string (all strings concatenated and separated by '
')
Definition at line 156 of file StringBijection.h.
References myT2String.
|
inline |
|
inline |
|
inline |
|
inline |
check if the given key exist
Definition at line 119 of file StringBijection.h.
References myT2String.
Referenced by getString(), and insert().
|
inline |
check if the given string exist
Definition at line 114 of file StringBijection.h.
References myString2T.
Referenced by get(), NWWriter_OpenDrive::getID(), and insert().
|
inline |
insert string and their associated key
Definition at line 69 of file StringBijection.h.
References has(), hasString(), myString2T, and myT2String.
Referenced by NWWriter_OpenDrive::getID(), and StringBijection().
|
inline |
remove string
Definition at line 89 of file StringBijection.h.
References myString2T, and myT2String.
|
inline |
get number of key-attributes
Definition at line 124 of file StringBijection.h.
References myString2T.
|
private |
map with the keys vinculated with strings
Definition at line 169 of file StringBijection.h.
Referenced by addAlias(), get(), hasString(), insert(), remove(), and size().
|
private |
map with the strings vinculated with keys
Definition at line 172 of file StringBijection.h.
Referenced by addKeysInto(), getMultilineString(), getString(), getStrings(), getValues(), has(), insert(), and remove().