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

virtual bool add (const std::string &id, MSJunction *item)
 Adds an item. More...
 
const std::vector< MSJunction * > & buildAndGetStaticVector () const
 
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...
 
MSJunctionget (const std::string &id) const
 Retrieves an item. More...
 
const IDMapgetMyMap () const
 
std::vector< MSJunction * > getTempVector () const
 
void insertIDs (std::vector< std::string > &into) const
 
 MSJunctionControl ()
 Constructor. More...
 
void postloadInitContainer ()
 Closes building of junctions. More...
 
virtual bool remove (const std::string &id)
 Removes an item. More...
 
int size () const
 Returns the number of 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 52 of file MSJunctionControl.h.

Member Typedef Documentation

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

Definition of the key to pointer map type.

Definition at line 57 of file NamedObjectCont.h.

Constructor & Destructor Documentation

MSJunctionControl::MSJunctionControl ( )

Constructor.

Definition at line 45 of file MSJunctionControl.cpp.

MSJunctionControl::~MSJunctionControl ( )

Destructor.

Definition at line 49 of file MSJunctionControl.cpp.

MSJunctionControl::MSJunctionControl ( const MSJunctionControl )
private

Invalidated copy constructor.

Member Function Documentation

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

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

const std::vector<MSJunction * >& NamedObjectCont< MSJunction * >::buildAndGetStaticVector ( ) const
inlineinherited

Definition at line 179 of file NamedObjectCont.h.

Referenced by postloadInitContainer().

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

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

Definition at line 123 of file NamedObjectCont.h.

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

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.

Parameters
[in]idThe id of the item to delete
Returns
Whether the object could be deleted (was within the map)

Definition at line 151 of file NamedObjectCont.h.

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

const IDMap& NamedObjectCont< MSJunction * >::getMyMap ( ) const
inlineinherited

Definition at line 224 of file NamedObjectCont.h.

std::vector<MSJunction * > NamedObjectCont< MSJunction * >::getTempVector ( ) const
inlineinherited

Definition at line 199 of file NamedObjectCont.h.

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

Definition at line 212 of file NamedObjectCont.h.

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

Invalidated assignment operator.

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

References NamedObjectCont< MSJunction * >::buildAndGetStaticVector().

Referenced by MSNet::closeBuilding().

virtual bool NamedObjectCont< MSJunction * >::remove ( const std::string &  id)
inlinevirtualinherited

Removes an item.

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

Definition at line 94 of file NamedObjectCont.h.

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

Returns the number of items within the container.

Returns
The number of stored items

Definition at line 137 of file NamedObjectCont.h.


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