Eclipse SUMO - Simulation of Urban MObility
|
A container for districts. More...
#include <NBDistrictCont.h>
Public Member Functions | |
bool | addSink (const std::string &dist, NBEdge *const destination, double weight) |
Adds a sink to the named district. | |
bool | addSource (const std::string &dist, NBEdge *const source, double weight) |
Adds a source to the named district. | |
std::map< std::string, NBDistrict * >::const_iterator | begin () const |
Returns the pointer to the begin of the stored districts. | |
std::map< std::string, NBDistrict * >::const_iterator | end () const |
Returns the pointer to the end of the stored districts. | |
bool | insert (NBDistrict *const district) |
Adds a district to the dictionary. | |
NBDistrictCont () | |
Constructor. | |
void | removeFromSinksAndSources (NBEdge *const e) |
Removes the given edge from the lists of sources and sinks in all stored districts. | |
NBDistrict * | retrieve (const std::string &id) const |
Returns the districts with the given id. | |
int | size () const |
Returns the number of districts inside the container. | |
~NBDistrictCont () | |
Destructor. | |
Private Types | |
typedef std::map< std::string, NBDistrict * > | DistrictCont |
The type of the dictionary where a node may be found by her id. | |
Private Member Functions | |
NBDistrictCont (const NBDistrictCont &s) | |
NBDistrictCont & | operator= (const NBDistrictCont &s) |
Private Attributes | |
DistrictCont | myDistricts |
The instance of the dictionary. | |
A container for districts.
A simple storage for district instances. Allows addition an retrieval of districts, filling them with sources/sinks, and some other methods which operate at all stored districts.
Definition at line 50 of file NBDistrictCont.h.
|
private |
The type of the dictionary where a node may be found by her id.
Definition at line 141 of file NBDistrictCont.h.
NBDistrictCont::NBDistrictCont | ( | ) |
Constructor.
Definition at line 35 of file NBDistrictCont.cpp.
NBDistrictCont::~NBDistrictCont | ( | ) |
|
private |
invalid copy constructor
bool NBDistrictCont::addSink | ( | const std::string & | dist, |
NBEdge *const | destination, | ||
double | weight | ||
) |
Adds a sink to the named district.
At first, the district is tried to be retrieved. If this fails, false is returned. Otherwise the retrieved districts NBDistrict::addSink-method is called.
[in] | dist | The id of the district to add the sink to |
[in] | source | An edge that shall be used as sink |
[in] | weight | An optional weight of the source |
Definition at line 85 of file NBDistrictCont.cpp.
References NBDistrict::addSink(), and retrieve().
Referenced by NIImporter_VISUM::parse_Connectors(), and NIImporter_VISUM::parse_Connectors_legacy().
bool NBDistrictCont::addSource | ( | const std::string & | dist, |
NBEdge *const | source, | ||
double | weight | ||
) |
Adds a source to the named district.
At first, the district is tried to be retrieved. If this fails, false is returned. Otherwise the retrieved districts NBDistrict::addSource-method is called.
[in] | dist | The id of the district to add the source to |
[in] | source | An edge that shall be used as source |
[in] | weight | An optional weight of the source |
Definition at line 74 of file NBDistrictCont.cpp.
References NBDistrict::addSource(), and retrieve().
Referenced by NIImporter_VISUM::parse_Connectors(), and NIImporter_VISUM::parse_Connectors_legacy().
|
inline |
Returns the pointer to the begin of the stored districts.
Definition at line 79 of file NBDistrictCont.h.
References myDistricts.
Referenced by NBNetBuilder::mirrorX(), NBNetBuilder::moveToOrigin(), NWWriter_XML::writeDistricts(), and NWWriter_SUMO::writeNetwork().
|
inline |
Returns the pointer to the end of the stored districts.
Definition at line 87 of file NBDistrictCont.h.
References myDistricts.
Referenced by NBNetBuilder::mirrorX(), NBNetBuilder::moveToOrigin(), NWWriter_XML::writeDistricts(), and NWWriter_SUMO::writeNetwork().
bool NBDistrictCont::insert | ( | NBDistrict *const | district | ) |
Adds a district to the dictionary.
[in] | district | The district to add |
Definition at line 47 of file NBDistrictCont.cpp.
References Named::getID(), and myDistricts.
Referenced by NIVissimDistrictConnection::dict_BuildDistrictNodes(), and NIImporter_VISUM::parse_Districts().
|
private |
invalid assignment operator
void NBDistrictCont::removeFromSinksAndSources | ( | NBEdge *const | e | ) |
Removes the given edge from the lists of sources and sinks in all stored districts.
This method simply goes through all stored districts and calls their method NBDistrict::removeFromSinksAndSources.
[in] | e | The edge to remove from sinks/sources |
Definition at line 96 of file NBDistrictCont.cpp.
References myDistricts.
Referenced by NBEdgeCont::extract().
NBDistrict * NBDistrictCont::retrieve | ( | const std::string & | id | ) | const |
Returns the districts with the given id.
[in] | id | The id of the district to retrieve |
Definition at line 58 of file NBDistrictCont.cpp.
References myDistricts.
Referenced by addSink(), addSource(), NIImporter_VISUM::buildDistrictNode(), and NIVissimDistrictConnection::dict_BuildDistricts().
int NBDistrictCont::size | ( | ) | const |
Returns the number of districts inside the container.
Definition at line 68 of file NBDistrictCont.cpp.
References myDistricts.
Referenced by NILoader::load(), and NWWriter_SUMO::writeNetwork().
|
private |
The instance of the dictionary.
Definition at line 144 of file NBDistrictCont.h.
Referenced by begin(), end(), insert(), removeFromSinksAndSources(), retrieve(), size(), and ~NBDistrictCont().