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

#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.
 

Detailed Description

This class builds string ids by adding an increasing numerical value to a previously given string

Definition at line 35 of file IDSupplier.h.

Constructor & Destructor Documentation

◆ IDSupplier() [1/2]

IDSupplier::IDSupplier ( const std::string &  prefix = "",
long long int  begin = 0 
)

Constructor.

Definition at line 34 of file IDSupplier.cpp.

◆ IDSupplier() [2/2]

IDSupplier::IDSupplier ( const std::string &  prefix,
const std::vector< std::string > &  knownIDs 
)

Constructor.

Parameters
[in]prefixThe string to use as ID prefix
[in]knownIDsList of IDs that should never be returned by this IDSupplier

Definition at line 39 of file IDSupplier.cpp.

References avoid().

◆ ~IDSupplier()

IDSupplier::~IDSupplier ( )

Destructor.

Definition at line 47 of file IDSupplier.cpp.

Member Function Documentation

◆ avoid()

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

Here is the caller graph for this function:

◆ getNext()

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

Here is the caller graph for this function:

Field Documentation

◆ myCurrent

long long int IDSupplier::myCurrent
private

The current index.

Definition at line 58 of file IDSupplier.h.

Referenced by avoid(), and getNext().

◆ myPrefix

std::string IDSupplier::myPrefix
private

The prefix to use.

Definition at line 61 of file IDSupplier.h.

Referenced by avoid(), and getNext().


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