45 #ifdef CHECK_MEMORY_LEAKS 47 #endif // CHECK_MEMORY_LEAKS 54 const std::string& file)
100 for (std::vector<std::string>::const_iterator i = desc.begin(); i != desc.end(); ++i) {
110 std::pair<std::string, SUMOReal> vals =
parseTAZ(attrs);
111 if (vals.second >= 0) {
119 std::pair<std::string, SUMOReal> vals =
parseTAZ(attrs);
120 if (vals.second >= 0) {
127 std::pair<std::string, SUMOReal>
131 return std::pair<std::string, SUMOReal>(
"", -1);
137 return std::pair<std::string, SUMOReal>(
"", -1);
145 return std::pair<std::string, SUMOReal>(id, weight);
148 return std::pair<std::string, SUMOReal>(
"", -1);
~ODDistrictHandler()
Destructor.
virtual bool add(const std::string &id, T item)
Adds an item.
void addSource(const SUMOSAXAttributes &attrs)
Adds a read source to the current district.
void addSink(const std::string &id, SUMOReal weight)
Adds a sink connection.
the weight of a district's source or sink
const std::string & getObjectType() const
return the objecttype to which these attributes belong
const std::string & getID() const
Returns the id.
SAX-handler base for SUMO-files.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called when an opening-tag occurs.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
std::pair< std::string, SUMOReal > parseTAZ(const SUMOSAXAttributes &attrs)
Returns the id and weight for a taz/tazSink/tazSource.
void addSource(const std::string &id, SUMOReal weight)
Adds a source connection.
Encapsulated SAX-Attributes.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
void myEndElement(int element)
Called when a closing tag occurs.
A container for districts.
void addSink(const SUMOSAXAttributes &attrs)
Adds a read sink to the current district.
ODDistrictHandler(ODDistrictCont &cont, const std::string &file)
Constructor.
virtual std::vector< std::string > getStringVector(int attr) const =0
Tries to read given attribute assuming it is a string vector.
void closeDistrict()
Closes the processing of the current district.
void openDistrict(const SUMOSAXAttributes &attrs)
Begins the parsing of a district.
ODDistrict * myCurrentDistrict
The currently parsed district.
ODDistrictCont & myContainer
The container to add read districts to.
A district (origin/destination)