SUMO - Simulation of Urban MObility
MSJunctionControl Class Reference

Container for junctions; performs operations on all stored junctions. More...

#include <MSJunctionControl.h>

Inheritance diagram for MSJunctionControl:
Inheritance graph
Collaboration diagram for MSJunctionControl:
Collaboration graph

Public Types

typedef std::map< std::string, MSJunction * > IDMap
 Definition of the key to pointer map type. More...
 

Public Member Functions

bool add (const std::string &id, MSJunction * 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...
 
MSJunctionget (const std::string &id) const
 Retrieves an item. More...
 
void insertIDs (std::vector< std::string > &into) const
 
 MSJunctionControl ()
 Constructor. More...
 
void postloadInitContainer ()
 Closes building of junctions. 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...
 
 ~MSJunctionControl ()
 Destructor. More...
 

Private Member Functions

 MSJunctionControl (const MSJunctionControl &)
 Invalidated copy constructor. More...
 
MSJunctionControloperator= (const MSJunctionControl &)
 Invalidated assignment operator. More...
 

Detailed Description

Container for junctions; performs operations on all stored junctions.

Definition at line 51 of file MSJunctionControl.h.

Member Typedef Documentation

◆ IDMap

typedef std::map< std::string, MSJunction * > NamedObjectCont< MSJunction * >::IDMap
inherited

Definition of the key to pointer map type.

Definition at line 54 of file NamedObjectCont.h.

Constructor & Destructor Documentation

◆ MSJunctionControl() [1/2]

MSJunctionControl::MSJunctionControl ( )

Constructor.

Definition at line 40 of file MSJunctionControl.cpp.

◆ ~MSJunctionControl()

MSJunctionControl::~MSJunctionControl ( )

Destructor.

Definition at line 44 of file MSJunctionControl.cpp.

◆ MSJunctionControl() [2/2]

MSJunctionControl::MSJunctionControl ( const MSJunctionControl )
private

Invalidated copy constructor.

Member Function Documentation

◆ add()

bool NamedObjectCont< MSJunction * >::add ( const std::string &  id,
MSJunction item 
)
inlineinherited

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 been added (no item with the same id was within the container before)

Definition at line 73 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

◆ begin()

IDMap::const_iterator NamedObjectCont< MSJunction * >::begin ( ) const
inlineinherited

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

Definition at line 152 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

◆ changeID()

bool NamedObjectCont< MSJunction * >::changeID ( const std::string &  oldId,
const std::string &  newId 
)
inlineinherited

change ID of a stored object

Definition at line 138 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

◆ clear()

void NamedObjectCont< MSJunction * >::clear ( )
inlineinherited

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

Definition at line 116 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

◆ end()

IDMap::const_iterator NamedObjectCont< MSJunction * >::end ( ) const
inlineinherited

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

Definition at line 157 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

◆ get()

MSJunction * NamedObjectCont< MSJunction * >::get ( const std::string &  id) const
inlineinherited

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

References NamedObjectCont< T >::myMap.

◆ insertIDs()

void NamedObjectCont< MSJunction * >::insertIDs ( std::vector< std::string > &  into) const
inlineinherited

Definition at line 131 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

◆ operator=()

MSJunctionControl& MSJunctionControl::operator= ( const MSJunctionControl )
private

Invalidated assignment operator.

◆ postloadInitContainer()

void MSJunctionControl::postloadInitContainer ( )

Closes building of junctions.

Calls "postloadInit" on all stored junctions.

Exceptions
ProcessErrorFrom the called "postloadInit"
See also
MSJunction::postloadInit

Definition at line 49 of file MSJunctionControl.cpp.

References NODETYPE_INTERNAL.

Referenced by MSNet::closeBuilding().

◆ remove()

bool NamedObjectCont< MSJunction * >::remove ( const std::string &  id,
const bool  del = true 
)
inlineinherited

Removes an item.

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

Definition at line 86 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.

◆ size()

int NamedObjectCont< MSJunction * >::size ( ) const
inlineinherited

Returns the number of stored items within the container.

Definition at line 124 of file NamedObjectCont.h.

References NamedObjectCont< T >::myMap.


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