 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
43 const std::string& file)
44 :
SUMOSAXHandler(file), myContainer(cont), myCurrentDistrict(nullptr) {}
89 for (std::vector<std::string>::const_iterator i = desc.begin(); i != desc.end(); ++i) {
99 std::pair<std::string, double> vals =
parseTAZ(attrs);
100 if (vals.second >= 0) {
108 std::pair<std::string, double> vals =
parseTAZ(attrs);
109 if (vals.second >= 0) {
116 std::pair<std::string, double>
120 return std::pair<std::string, double>(
"", -1);
126 return std::pair<std::string, double>(
"", -1);
134 return std::pair<std::string, double>(
id, weight);
137 return std::pair<std::string, double>(
"", -1);
const std::vector< std::string > getStringVector(int attr) const
Tries to read given attribute assuming it is a string vector.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SAX-handler base for SUMO-files.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
a source within a district (connection road)
const std::string & getObjectType() const
return the objecttype to which these attributes belong
ODDistrict * myCurrentDistrict
The currently parsed district.
void addSource(const SUMOSAXAttributes &attrs)
Adds a read source to the current district.
void addSink(const SUMOSAXAttributes &attrs)
Adds a read sink to the current district.
void addSink(const std::string &id, double weight)
Adds a sink connection.
void closeDistrict()
Closes the processing of the current district.
A district (origin/destination)
void addSource(const std::string &id, double weight)
Adds a source connection.
std::pair< std::string, double > parseTAZ(const SUMOSAXAttributes &attrs)
Returns the id and weight for a taz/tazSink/tazSource.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called when an opening-tag occurs.
ODDistrictHandler(ODDistrictCont &cont, const std::string &file)
Constructor.
A container for districts.
a traffic assignment zone
void openDistrict(const SUMOSAXAttributes &attrs)
Begins the parsing of a district.
a sink within a district (connection road)
ODDistrictCont & myContainer
The container to add read districts to.
void myEndElement(int element)
Called when a closing tag occurs.
~ODDistrictHandler()
Destructor.
Encapsulated SAX-Attributes.
const std::string & getID() const
Returns the id.
bool add(const std::string &id, T item)
Adds an item.