IDSupplier Class Reference

#include <IDSupplier.h>


Detailed Description

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

Definition at line 43 of file IDSupplier.h.


Public Member Functions

std::string getNext ()
 Returns the next id.
 IDSupplier (const std::string &prefix="", long begin=0)
 Constructor.
 ~IDSupplier ()
 Destructor.

Private Attributes

long myCurrent
 The current index.
std::string myPrefix
 The prefix to use.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 42 of file IDSupplier.cpp.

00043         : myCurrent(begin), myPrefix(prefix) {}

IDSupplier::~IDSupplier (  ) 

Destructor.

Definition at line 46 of file IDSupplier.cpp.

00046 {}


Member Function Documentation

std::string IDSupplier::getNext (  ) 

Returns the next id.

Definition at line 50 of file IDSupplier.cpp.

References myCurrent, and myPrefix.

Referenced by RORDLoader_TripDefs::getVehicleID().

00050                     {
00051     std::ostringstream strm;
00052     strm << myPrefix << myCurrent++;
00053     return strm.str();
00054 }


Field Documentation

long IDSupplier::myCurrent [private]

The current index.

Definition at line 56 of file IDSupplier.h.

Referenced by getNext().

std::string IDSupplier::myPrefix [private]

The prefix to use.

Definition at line 59 of file IDSupplier.h.

Referenced by getNext().


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

Generated on Wed May 5 00:06:46 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6