32 bool operator()(
const T*
const a,
const T*
const b)
const {
33 return a->getID() < b->getID();
41 bool operator()(
const T*
const a,
const T*
const b)
const {
42 return a->getNumericalID() < b->getNumericalID();
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 virtual void setID(
const std::string& newID) {
Allows to store the object; used as context while traveling the rtree in TraCI.
std::set< const Named * > & myObjects
The container.
void add(const Named *const o) const
Adds the given object to the container.
StoringVisitor(std::set< const Named * > &objects)
Constructor.
StoringVisitor & operator=(const StoringVisitor &src)
invalidated assignment operator
StoringVisitor(const StoringVisitor &src)
invalidated copy constructor
~StoringVisitor()
Destructor.
Base class for objects which have an id.
Named(const std::string &id)
Constructor.
std::string myID
The name of the object.
void addTo(const StoringVisitor &cont) const
Adds this object to the given container.
virtual void setID(const std::string &newID)
resets the id
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.
virtual ~Named()
Destructor.
Function-object for stable sorting of objects acting like Named without being derived (SUMOVehicle)
bool operator()(const T *const a, const T *const b) const
Function-object for stable sorting of objects with numerical ids.
bool operator()(const T *const a, const T *const b) const