Eclipse SUMO - Simulation of Urban MObility
NamedObjectCont< T > Class Template Reference

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...
 
get (const std::string &id) const
 Retrieves an item. More...
 
void insertIDs (std::vector< std::string > &into) const
 
 NamedObjectCont ()
 Constructor. More...
 
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...
 

Detailed Description

template<class T>
class NamedObjectCont< T >

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 41 of file NamedObjectCont.h.

Member Typedef Documentation

◆ IDMap

template<class T >
typedef std::map< std::string, T > NamedObjectCont< T >::IDMap

Definition of the key to pointer map type.

Definition at line 44 of file NamedObjectCont.h.

Constructor & Destructor Documentation

◆ NamedObjectCont()

template<class T >
NamedObjectCont< T >::NamedObjectCont ( )
inline

Constructor.

Definition at line 47 of file NamedObjectCont.h.

◆ ~NamedObjectCont()

template<class T >
virtual NamedObjectCont< T >::~NamedObjectCont ( )
inlinevirtual

Destructor.

Definition at line 50 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

Member Function Documentation

◆ add()

template<class T >
bool NamedObjectCont< T >::add ( const std::string &  id,
item 
)
inline

Adds an item.

If another item with the same name is already known, false is reported and the item is not added.

Parameters
[in]idThe id of the item to add
[in]itemThe item to add
Returns
If the item could be added (no item with the same id was within the container before)

Definition at line 66 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

Referenced by ShapeContainer::add(), RONet::addEdge(), RONet::addFlow(), RONet::addNode(), GUIShapeContainer::addPOI(), GUIShapeContainer::addPolygon(), RONet::addRouteDef(), RONet::addVehicleType(), ODDistrictHandler::closeDistrict(), NLJunctionControlBuilder::closeJunction(), and RONet::RONet().

Here is the caller graph for this function:

◆ begin()

template<class T >
IDMap::const_iterator NamedObjectCont< T >::begin ( ) const
inline

Returns a reference to the begin iterator for the internal map.

Definition at line 146 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

Referenced by NLBuilder::build(), ROMAAssignments::incremental(), NWWriter_OpenDrive::mapmatchRoadObjects(), GUIViewTraffic::onGamingClick(), ROMAAssignments::resetFlows(), ROMAAssignments::sue(), and ROMAAssignments::writeInterval().

Here is the caller graph for this function:

◆ changeID()

template<class T >
bool NamedObjectCont< T >::changeID ( const std::string &  oldId,
const std::string &  newId 
)
inline

change ID of a stored object

Definition at line 132 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

◆ clear()

template<class T >
void NamedObjectCont< T >::clear ( )
inline

Removes all items from the container (deletes them, too)

Definition at line 110 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

Referenced by PCPolyContainer::~PCPolyContainer().

Here is the caller graph for this function:

◆ end()

template<class T >
IDMap::const_iterator NamedObjectCont< T >::end ( ) const
inline

Returns a reference to the end iterator for the internal map.

Definition at line 151 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

Referenced by NLBuilder::build(), ROMAAssignments::incremental(), NWWriter_OpenDrive::mapmatchRoadObjects(), GUIViewTraffic::onGamingClick(), ROMAAssignments::resetFlows(), ROMAAssignments::sue(), and ROMAAssignments::writeInterval().

Here is the caller graph for this function:

◆ get()

template<class T >
T NamedObjectCont< T >::get ( const std::string &  id) const
inline

Retrieves an item.

Returns 0 when no item with the given id is stored within the container

Parameters
[in]idThe id of the item to retrieve
Returns
The item stored under the given id, or 0 if no such item exists

Definition at line 100 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

Referenced by LIBSUMO_NAMESPACE::POI::add(), LIBSUMO_NAMESPACE::Polygon::add(), ODMatrix::add(), MSPModel_JuPedSim::add(), NLHandler::addDistrict(), NLNetShapeHandler::addJunction(), GUIShapeContainer::addPOI(), ShapeHandler::addPOI(), ShapeHandler::addPoly(), GUIShapeContainer::addPolygon(), ShapeContainer::addPolygonDynamics(), MSDevice_FCD::buildShapeFilter(), RONet::checkVType(), ODMatrix::computeDeparts(), LIBSUMO_NAMESPACE::Polygon::exists(), LIBSUMO_NAMESPACE::LaneArea::getDetector(), LIBSUMO_NAMESPACE::MultiEntryExit::getDetector(), LIBSUMO_NAMESPACE::InductionLoop::getDetector(), RONet::getEdge(), LIBSUMO_NAMESPACE::Junction::getJunction(), GUINet::getJunctionPosition(), LIBSUMO_NAMESPACE::InductionLoop::getMEDetector(), RONet::getNode(), LIBSUMO_NAMESPACE::POI::getPoI(), LIBSUMO_NAMESPACE::Polygon::getPolygon(), RONet::getRouteDef(), LIBSUMO_NAMESPACE::RouteProbe::getRouteProbe(), RONet::getVehicleTypeSecure(), MSDelayBasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), NEMALogic::init(), MSDevice_SSM::initEdgeFilter(), PCLoaderVisum::load(), PCLoaderDlrNavteq::loadPolyFile(), ShapeContainer::movePOI(), GUIShapeContainer::movePOI(), NLTriggerBuilder::parseAndBuildCalibrator(), MSPModel_JuPedSim::preparePolygonForDrawing(), LIBSUMO_NAMESPACE::POI::remove(), LIBSUMO_NAMESPACE::Polygon::remove(), GUIShapeContainer::removePOI(), GUIShapeContainer::removePolygon(), ShapeContainer::removePolygonDynamics(), ShapeContainer::reshapePolygon(), GUIShapeContainer::reshapePolygon(), NLJunctionControlBuilder::retrieve(), MSActuatedTrafficLightLogic::retrieveDetExpression(), RONet::setBidiEdges(), NWWriter_OpenDrive::writeNetwork(), NWWriter_OpenDrive::writeRoadObjects(), and NWWriter_OpenDrive::writeSignals().

◆ insertIDs()

template<class T >
void NamedObjectCont< T >::insertIDs ( std::vector< std::string > &  into) const
inline

Definition at line 125 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

◆ remove()

template<class T >
bool NamedObjectCont< T >::remove ( const std::string &  id,
const bool  del = true 
)
inline

Removes an item.

Parameters
[in]idThe id of the item to remove
[in]deldelete item after removing of container
Returns
If the item could be removed (an item with the id was within the container before)

Definition at line 80 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

Referenced by GUIShapeContainer::addPOI(), GUIShapeContainer::addPolygon(), RONet::checkVType(), ShapeContainer::removePOI(), GUIShapeContainer::removePOI(), ShapeContainer::removePolygon(), RONet::saveAndRemoveRoutesUntil(), and RONet::~RONet().

Here is the caller graph for this function:

◆ size()

template<class T >
int NamedObjectCont< T >::size ( ) const
inline

Returns the number of stored items within the container.

Definition at line 118 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

Referenced by MSDevice_FCD::buildShapeFilter(), RONet::furtherStored(), RONet::getEdgeNumber(), GUINet::initGUIStructures(), main(), and NWWriter_OpenDrive::mapmatchRoadObjects().

Here is the caller graph for this function:

Field Documentation

◆ myMap


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