![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <IDSupplier.h>
Public Member Functions | |
| void | avoid (const std::string &id) |
| make sure that the given id is never supplied | |
| std::string | getNext () |
| Returns the next id. | |
| IDSupplier (const std::string &prefix, const std::vector< std::string > &knownIDs) | |
| Constructor. | |
| IDSupplier (const std::string &prefix="", long long int begin=0) | |
| Constructor. | |
| ~IDSupplier () | |
| Destructor. | |
Private Attributes | |
| long long int | myCurrent |
| The current index. | |
| std::string | myPrefix |
| The prefix to use. | |
This class builds string ids by adding an increasing numerical value to a previously given string
Definition at line 35 of file IDSupplier.h.
| IDSupplier::IDSupplier | ( | const std::string & | prefix = "", |
| long long int | begin = 0 |
||
| ) |
Constructor.
Definition at line 34 of file IDSupplier.cpp.
| IDSupplier::IDSupplier | ( | const std::string & | prefix, |
| const std::vector< std::string > & | knownIDs | ||
| ) |
Constructor.
| [in] | prefix | The string to use as ID prefix |
| [in] | knownIDs | List of IDs that should never be returned by this IDSupplier |
Definition at line 39 of file IDSupplier.cpp.
References avoid().
| IDSupplier::~IDSupplier | ( | ) |
Destructor.
Definition at line 47 of file IDSupplier.cpp.
| void IDSupplier::avoid | ( | const std::string & | id | ) |
make sure that the given id is never supplied
Definition at line 59 of file IDSupplier.cpp.
References MAX2(), myCurrent, and myPrefix.
Referenced by NBTrafficLightLogicCont::getNextProgramID(), and IDSupplier().
| std::string IDSupplier::getNext | ( | ) |
Returns the next id.
Definition at line 51 of file IDSupplier.cpp.
References myCurrent, and myPrefix.
Referenced by NBTrafficLightLogicCont::getNextProgramID(), NBEdgeCont::remapIDs(), NBNodeCont::remapIDs(), NWWriter_DlrNavteq::writeNodesUnsplitted(), and NWWriter_DlrNavteq::writeProhibitedManoeuvres().
|
private |
The current index.
Definition at line 58 of file IDSupplier.h.
|
private |
The prefix to use.
Definition at line 61 of file IDSupplier.h.