51 : myAttributeName(attributeName), myAmEdgeBased(edgeBased), myDestination(destination) {
63 const std::string& file)
69 const std::string& file)
77 std::vector<ToRetrieveDefinition*>::iterator i;
112 std::vector<ToRetrieveDefinition*>::iterator i;
116 if ((*i)->myAmEdgeBased) {
118 (*i)->myAggValue = attrs.
getFloat((*i)->myAttributeName);
120 (*i)->myHadAttribute =
true;
122 (*i)->myHadAttribute =
false;
125 (*i)->myAggValue = 0;
132 if (!(*i)->myAmEdgeBased) {
134 (*i)->myAggValue += attrs.
getFloat((*i)->myAttributeName);
136 (*i)->myHadAttribute =
true;
151 std::vector<ToRetrieveDefinition*>::iterator i;
153 if ((*i)->myHadAttribute) {
155 (*i)->myAggValue / (
double)(*i)->myNoLanes,
Interface for a class which obtains read weights for named edges.
begin/end of the description of a single lane
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
double myCurrentTimeBeg
the begin of the time period that is currently processed
weights: time range begin
SAX-handler base for SUMO-files.
~SAXWeightsHandler()
Destructor.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
std::string myCurrentEdgeID
the edge which is currently being processed
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void tryParse(const SUMOSAXAttributes &attrs, bool isEdge)
Parses the efforts of a lane for the previously read times.
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.
double myCurrentTimeEnd
the end of the time period that is currently processed
SAXWeightsHandler(const std::vector< ToRetrieveDefinition *> &defs, const std::string &file)
Constructor.
void myEndElement(int elemente)
Called when a closing tag occurs.
std::vector< ToRetrieveDefinition * > myDefinitions
List of definitions what shall be read and whereto stored while parsing the file. ...
begin/end of the description of an edge
Complete definition about what shall be retrieved and where to store it.
virtual double getFloat(int id) const =0
Returns the double-value of the named (by its enum-value) attribute.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
ToRetrieveDefinition(const std::string &attributeName, bool edgeBased, EdgeFloatTimeLineRetriever &destination)
Constructor.
an aggreagated-output interval
~ToRetrieveDefinition()
Destructor.