![]() |
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 | |
| virtual bool | add (const std::string &id, T item) |
| Adds an item. 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... | |
| bool | erase (const std::string &id) |
| Removes the named item from the container. More... | |
| T | get (const std::string &id) const |
| Retrieves an item. More... | |
| const IDMap & | getMyMap () const |
| Returns a reference to the internal map. More... | |
| void | insertIDs (std::vector< std::string > &into) const |
| NamedObjectCont () | |
| Constructor. More... | |
| virtual bool | remove (const std::string &id) |
| Removes an item. More... | |
| int | size () const |
| Returns the number of stored items within the container. More... | |
| virtual | ~NamedObjectCont () |
| Destructor. More... | |
Private Types | |
| typedef IDMap::iterator | myContIt |
| Definition of the container type iterator. More... | |
| typedef std::vector< T > | ObjectVector |
| Definition objects vector. More... | |
Private Attributes | |
| bool | myHaveChanged |
| Information whether the vector is out of sync with the map. More... | |
| IDMap | myMap |
| The map from key to object. More... | |
| ObjectVector | myVector |
| The stored vector of all known items. More... | |
A map of named object pointers.
An associative storage (map) for objects (pointers to them to be exact), which do have a name. In order to get the stored objects as a list, each insertion/deletion sets the internal state value "myHaveChanged" to true, indicating the list must be rebuild.
Definition at line 54 of file NamedObjectCont.h.
| typedef std::map< std::string, T > NamedObjectCont< T >::IDMap |
Definition of the key to pointer map type.
Definition at line 57 of file NamedObjectCont.h.
|
private |
Definition of the container type iterator.
Definition at line 196 of file NamedObjectCont.h.
|
private |
Definition objects vector.
Definition at line 202 of file NamedObjectCont.h.
|
inline |
Constructor.
Definition at line 60 of file NamedObjectCont.h.
|
inlinevirtual |
Destructor.
Definition at line 63 of file NamedObjectCont.h.
|
inlinevirtual |
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 79 of file NamedObjectCont.h.
Referenced by ShapeContainer::add(), MSNet::addBusStop(), MSNet::addChargingStation(), MSNet::addContainerStop(), RONet::addEdge(), RONet::addFlow(), RONet::addNode(), MSNet::addParkingArea(), GUIShapeContainer::addPOI(), GNENet::addPOI(), GUIShapeContainer::addPolygon(), GNENet::addPolygon(), RONet::addRouteDef(), RONet::addVehicleType(), ODDistrictHandler::closeDistrict(), NLJunctionControlBuilder::closeJunction(), and RONet::RONet().
|
inline |
change ID of a stored object
Definition at line 175 of file NamedObjectCont.h.
Referenced by GNENet::changePOIID(), and GNENet::changePolygonID().
|
inline |
Removes all items from the container (deletes them, too)
Definition at line 122 of file NamedObjectCont.h.
Referenced by PCPolyContainer::~PCPolyContainer(), and RONet::~RONet().
|
inline |
Removes the named item from the container.
If the named object exists, it is deleted, the key is removed from the map, and true is returned. If the id was not known, false is returned.
| [in] | id | The id of the item to delete |
Definition at line 145 of file NamedObjectCont.h.
Referenced by RONet::checkFlows(), RONet::saveAndRemoveRoutesUntil(), and RONet::~RONet().
|
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 112 of file NamedObjectCont.h.
Referenced by ODMatrix::add(), ShapeHandler::addPOI(), GNENet::addPOI(), ShapeHandler::addPoly(), GNENet::addPolygon(), GNENet::addPolygonForEditShapes(), GNENet::changePOIID(), GNENet::changePolygonID(), RONet::checkVType(), ODMatrix::computeDeparts(), GNENet::generatePOIID(), GNENet::generatePolyID(), MSNet::getBusStop(), MSNet::getChargingStation(), MSNet::getContainerStop(), TraCI_MultiEntryExit::getDetector(), TraCI_InductionLoop::getDetector(), TraCI_LaneArea::getDetector(), RONet::getEdge(), TraCI_Junction::getJunction(), GUINet::getJunctionPosition(), RONet::getNode(), MSNet::getParkingArea(), TraCI_POI::getPoI(), TraCIServerAPI_POI::getPoI(), TraCI_Polygon::getPolygon(), TraCIServerAPI_Polygon::getPolygon(), TraCIServerAPI_InductionLoop::getPosition(), RONet::getRouteDef(), RONet::getVehicleTypeSecure(), PCLoaderDlrNavteq::loadPolyFile(), ShapeContainer::movePOI(), GUIShapeContainer::movePOI(), NLTriggerBuilder::parseAndBuildCalibrator(), GUIShapeContainer::removePOI(), GNENet::removePOI(), GUIShapeContainer::removePolygon(), GNENet::removePolygon(), ShapeContainer::reshapePolygon(), GUIShapeContainer::reshapePolygon(), NLJunctionControlBuilder::retrieve(), GNENet::retrievePOI(), and GNENet::retrievePolygon().
|
inline |
Returns a reference to the internal map.
Definition at line 189 of file NamedObjectCont.h.
Referenced by RONet::adaptIntermodalRouter(), RONet::checkFlows(), GNENet::computeAndUpdate(), GNEViewNet::deleteSelectedPOIs(), GNEViewNet::deleteSelectedPolygons(), MSNet::getBusStopID(), MSNet::getChargingStationID(), MSNet::getContainerStopID(), RONet::getEdgeMap(), GNENet::getGlIDs(), MSNet::getParkingAreaID(), GUIShapeContainer::getPOIIds(), GUIShapeContainer::getPolygonIDs(), TraCIServerAPI_InductionLoop::getTree(), TraCIServerAPI_Junction::getTree(), TraCIServerAPI_POI::getTree(), TraCIServerAPI_Polygon::getTree(), GUINet::initGUIStructures(), GNESelectorFrame::onCmdInvert(), PCPolyContainer::save(), PCPolyContainer::saveDlrTDP(), GNENet::saveShapes(), MSDetectorControl::updateDetectors(), and MSNet::writeChargingStationOutput().
|
inline |
Definition at line 167 of file NamedObjectCont.h.
Referenced by TraCI_LaneArea::getIDList(), TraCI_MultiEntryExit::getIDList(), TraCI_Polygon::getIDList(), TraCI_InductionLoop::getIDList(), TraCI_POI::getIDList(), and TraCI_Junction::getIDList().
|
inlinevirtual |
Removes an item.
| [in] | id | The id of the item to remove |
| [in] | del | delete item after removing of container |
Definition at line 93 of file NamedObjectCont.h.
Referenced by RONet::checkVType(), ShapeContainer::removePOI(), GUIShapeContainer::removePOI(), GNENet::removePOI(), ShapeContainer::removePolygon(), GUIShapeContainer::removePolygon(), and GNENet::removePolygon().
|
inline |
Returns the number of stored items within the container.
Definition at line 132 of file NamedObjectCont.h.
Referenced by RONet::furtherStored(), RONet::getEdgeNo(), TraCI_MultiEntryExit::getIDCount(), TraCI_LaneArea::getIDCount(), TraCI_InductionLoop::getIDCount(), GNENet::getNumberOfShapes(), GUINet::initGUIStructures(), and main().
|
mutableprivate |
Information whether the vector is out of sync with the map.
Definition at line 208 of file NamedObjectCont.h.
Referenced by NamedObjectCont< RONode * >::add(), NamedObjectCont< RONode * >::clear(), NamedObjectCont< RONode * >::erase(), and NamedObjectCont< RONode * >::remove().
|
private |
The map from key to object.
Definition at line 199 of file NamedObjectCont.h.
Referenced by NamedObjectCont< RONode * >::add(), NamedObjectCont< RONode * >::changeID(), NamedObjectCont< RONode * >::clear(), NamedObjectCont< RONode * >::erase(), NamedObjectCont< RONode * >::get(), NamedObjectCont< RONode * >::getMyMap(), NamedObjectCont< RONode * >::insertIDs(), NamedObjectCont< RONode * >::remove(), NamedObjectCont< RONode * >::size(), and NamedObjectCont< RONode * >::~NamedObjectCont().
|
mutableprivate |
The stored vector of all known items.
Definition at line 205 of file NamedObjectCont.h.
Referenced by NamedObjectCont< RONode * >::clear(), and NamedObjectCont< RONode * >::erase().