![]() |
Eclipse SUMO - Simulation of Urban MObility
|
A map of named object pointers. More...
#include <NamedObjectCont.h>
Public Types | |
typedef std::map< std::string, T > | IDMap |
Definition of the key to pointer map type. More... | |
Public Member Functions | |
bool | add (const std::string &id, T item) |
Adds an item. More... | |
IDMap::const_iterator | begin () const |
Returns a reference to the begin iterator for the internal map. More... | |
bool | changeID (const std::string &oldId, const std::string &newId) |
change ID of a stored object More... | |
void | clear () |
Removes all items from the container (deletes them, too) More... | |
IDMap::const_iterator | end () const |
Returns a reference to the end iterator for the internal map. More... | |
T | get (const std::string &id) const |
Retrieves an item. More... | |
void | insertIDs (std::vector< std::string > &into) const |
bool | remove (const std::string &id, const bool del=true) |
Removes an item. More... | |
int | size () const |
Returns the number of stored items within the container. More... | |
virtual | ~NamedObjectCont () |
Destructor. More... | |
Private Attributes | |
IDMap | myMap |
The map from key to object. More... | |
A map of named object pointers.
An associative storage (map) for objects (pointers to them to be exact), which do have a name.
Definition at line 43 of file NamedObjectCont.h.
typedef std::map< std::string, T > NamedObjectCont< T >::IDMap |
Definition of the key to pointer map type.
Definition at line 46 of file NamedObjectCont.h.
|
inlinevirtual |
Destructor.
Definition at line 49 of file NamedObjectCont.h.
|
inline |
Adds an item.
If another item with the same name is already known, false is reported and the item is not added.
[in] | id | The id of the item to add |
[in] | item | The item to add |
Definition at line 65 of file NamedObjectCont.h.
Referenced by ShapeContainer::add(), RONet::addEdge(), RONet::addFlow(), RONet::addNode(), GUIShapeContainer::addPOI(), GNENet::addPOI(), GUIShapeContainer::addPolygon(), RONet::addRouteDef(), RONet::addVehicleType(), ODDistrictHandler::closeDistrict(), NLJunctionControlBuilder::closeJunction(), GNENet::insertShape(), and RONet::RONet().
|
inline |
Returns a reference to the begin iterator for the internal map.
Definition at line 144 of file NamedObjectCont.h.
Referenced by ROMAAssignments::incremental(), GUIViewTraffic::onGamingClick(), ROMAAssignments::resetFlows(), ROMAAssignments::sue(), and writeInterval().
|
inline |
change ID of a stored object
Definition at line 130 of file NamedObjectCont.h.
Referenced by GNENet::changeShapeID().
|
inline |
Removes all items from the container (deletes them, too)
Definition at line 108 of file NamedObjectCont.h.
Referenced by GNENet::computeAndUpdate(), and PCPolyContainer::~PCPolyContainer().
|
inline |
Returns a reference to the end iterator for the internal map.
Definition at line 149 of file NamedObjectCont.h.
Referenced by ROMAAssignments::incremental(), GUIViewTraffic::onGamingClick(), ROMAAssignments::resetFlows(), ROMAAssignments::sue(), and writeInterval().
|
inline |
Retrieves an item.
Returns 0 when no item with the given id is stored within the container
[in] | id | The id of the item to retrieve |
Definition at line 98 of file NamedObjectCont.h.
Referenced by ODMatrix::add(), ShapeHandler::addPOI(), GUIShapeContainer::addPOI(), GNENet::addPOI(), ShapeHandler::addPoly(), GUIShapeContainer::addPolygon(), GNENet::addPolygon(), ShapeContainer::addPolygonDynamics(), GNENet::changeShapeID(), RONet::checkVType(), ODMatrix::computeDeparts(), libsumo::Polygon::exists(), GNENet::generateShapeID(), libsumo::MultiEntryExit::getDetector(), libsumo::LaneArea::getDetector(), libsumo::InductionLoop::getDetector(), RONet::getEdge(), libsumo::Junction::getJunction(), GUINet::getJunctionPosition(), RONet::getNode(), libsumo::POI::getPoI(), libsumo::Polygon::getPolygon(), RONet::getRouteDef(), RONet::getVehicleTypeSecure(), PCLoaderDlrNavteq::loadPolyFile(), GUIShapeContainer::movePOI(), ShapeContainer::movePOI(), NLTriggerBuilder::parseAndBuildCalibrator(), GNEAdditionalHandler::parseAndBuildPOI(), GNEAdditionalHandler::parseAndBuildPoly(), GUIShapeContainer::removePOI(), GUIShapeContainer::removePolygon(), ShapeContainer::removePolygonDynamics(), GUIShapeContainer::reshapePolygon(), ShapeContainer::reshapePolygon(), NLJunctionControlBuilder::retrieve(), GNENet::retrievePOI(), GNENet::retrievePolygon(), and NWWriter_OpenDrive::writeRoadObjects().
|
inline |
Definition at line 123 of file NamedObjectCont.h.
Referenced by libsumo::LaneArea::getIDList(), libsumo::MultiEntryExit::getIDList(), libsumo::Polygon::getIDList(), libsumo::InductionLoop::getIDList(), libsumo::Junction::getIDList(), and libsumo::POI::getIDList().
|
inline |
Removes an item.
[in] | id | The id of the item to remove |
[in] | del | delete item after removing of container |
Definition at line 78 of file NamedObjectCont.h.
Referenced by GUIShapeContainer::addPOI(), GUIShapeContainer::addPolygon(), RONet::checkVType(), GUIShapeContainer::removePOI(), ShapeContainer::removePOI(), ShapeContainer::removePolygon(), GNENet::removeShape(), RONet::saveAndRemoveRoutesUntil(), GNEChange_Shape::~GNEChange_Shape(), and RONet::~RONet().
|
inline |
Returns the number of stored items within the container.
Definition at line 116 of file NamedObjectCont.h.
Referenced by GNESelectorFrame::ACsToSelected(), RONet::furtherStored(), GNEPoly::generateChildID(), GNEPOI::generateChildID(), RONet::getEdgeNumber(), libsumo::LaneArea::getIDCount(), libsumo::MultiEntryExit::getIDCount(), libsumo::InductionLoop::getIDCount(), GNENet::getNumberOfShapes(), GUINet::initGUIStructures(), and main().
|
private |
The map from key to object.
Definition at line 156 of file NamedObjectCont.h.
Referenced by NamedObjectCont< RONode * >::add(), NamedObjectCont< RONode * >::begin(), NamedObjectCont< RONode * >::changeID(), NamedObjectCont< RONode * >::clear(), NamedObjectCont< RONode * >::end(), NamedObjectCont< RONode * >::get(), NamedObjectCont< RONode * >::insertIDs(), NamedObjectCont< RONode * >::remove(), NamedObjectCont< RONode * >::size(), and NamedObjectCont< RONode * >::~NamedObjectCont().