41 bool operator()(
const T*
const a,
const T*
const b)
const {
42 return a->getID() < b->getID();
59 Named(
const std::string&
id) : myID(id) { }
67 static std::string
getIDSecure(
const T* obj,
const std::string& fallBack =
"NULL") {
68 return obj == 0 ? fallBack : obj->getID();
74 const std::string&
getID()
const {
82 void setID(
const std::string& newID) {
100 myIDs.insert(o->
getID());
virtual ~Named()
Destructor.
void add(const Named *const o) const
Adds the given object to the container.
void addTo(const StoringVisitor &cont) const
Adds this object to the given container.
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
const std::string & getID() const
Returns the id.
~StoringVisitor()
Destructor.
bool operator()(const T *const a, const T *const b) const
StoringVisitor(std::set< std::string > &ids)
Contructor.
Named(const std::string &id)
Constructor.
Base class for objects which have an id.
Allows to store the object; used as context while traveling the rtree in TraCI.
std::string myID
The name of the object.
void setID(const std::string &newID)
resets the id
std::set< std::string > & myIDs
The container.
Function-object for stable sorting of objects acting like Named without being derived (SUMOVehicle) ...