Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSJunctionControl Class Reference

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

#include <MSJunctionControl.h>

Inheritance diagram for MSJunctionControl:
[legend]
Collaboration diagram for MSJunctionControl:
[legend]

Public Types

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

Public Member Functions

bool add (const std::string &id, MSJunction * item)
 Adds an item.
 
IDMap::const_iterator begin () const
 Returns a reference to the begin iterator for the internal map.
 
bool changeID (const std::string &oldId, const std::string &newId)
 change ID of a stored object
 
void clear ()
 Removes all items from the container (deletes them, too)
 
IDMap::const_iterator end () const
 Returns a reference to the end iterator for the internal map.
 
MSJunctionget (const std::string &id) const
 Retrieves an item.
 
void insertIDs (std::vector< std::string > &into) const
 
 MSJunctionControl ()
 Constructor.
 
void postloadInitContainer ()
 Closes building of junctions.
 
bool remove (const std::string &id, const bool del=true)
 Removes an item.
 
int size () const
 Returns the number of stored items within the container.
 
 ~MSJunctionControl ()
 Destructor.
 

Private Member Functions

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

Private Attributes

IDMap myMap
 The map from key to object.
 

Detailed Description

Container for junctions; performs operations on all stored junctions.

Definition at line 42 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 44 of file NamedObjectCont.h.

Constructor & Destructor Documentation

◆ MSJunctionControl() [1/2]

MSJunctionControl::MSJunctionControl ( )

Constructor.

Definition at line 33 of file MSJunctionControl.cpp.

◆ ~MSJunctionControl()

MSJunctionControl::~MSJunctionControl ( )

Destructor.

Definition at line 37 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 be added (no item with the same id was within the container before)

Definition at line 66 of file NamedObjectCont.h.

◆ begin()

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

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

Definition at line 146 of file NamedObjectCont.h.

◆ changeID()

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

change ID of a stored object

Definition at line 132 of file NamedObjectCont.h.

◆ clear()

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

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

Definition at line 110 of file NamedObjectCont.h.

◆ end()

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

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

Definition at line 151 of file NamedObjectCont.h.

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

◆ insertIDs()

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

Definition at line 125 of file NamedObjectCont.h.

◆ 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 42 of file MSJunctionControl.cpp.

References INTERNAL, and MSLink::recheckSetRequestInformation().

Referenced by NLBuilder::buildNet().

Here is the caller graph for this function:

◆ 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 be removed (an item with the id was within the container before)

Definition at line 80 of file NamedObjectCont.h.

◆ size()

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

Returns the number of stored items within the container.

Definition at line 118 of file NamedObjectCont.h.

Field Documentation

◆ myMap

IDMap NamedObjectCont< MSJunction * >::myMap
privateinherited

The map from key to object.

Definition at line 158 of file NamedObjectCont.h.


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