![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Encapsulated SAX-Attributes. More...
#include <SUMOSAXAttributes.h>
Public Member Functions | |
template<typename T > | |
T | get (int attr, const char *objectid, bool &ok, bool report=true) const |
Tries to read given attribute assuming it is an int. More... | |
template<> | |
std::string | getInternal (const int attr) const |
template<typename T > | |
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. More... | |
SUMOTime | getOptSUMOTimeReporting (int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const |
Tries to read given attribute assuming it is a SUMOTime. More... | |
SUMOTime | getSUMOTimeReporting (int attr, const char *objectid, bool &ok, bool report=true) const |
Tries to read given attribute assuming it is a SUMOTime. More... | |
SUMOSAXAttributes (const std::string &objectType) | |
virtual | ~SUMOSAXAttributes () |
Destructor. More... | |
virtual methods for retrieving attribute values | |
static const std::string | ENCODING = " encoding=\"UTF-8\"" |
The encoding of parsed strings. More... | |
std::string | myObjectType |
the object type to use in error reporting More... | |
virtual bool | hasAttribute (int id) const =0 |
Returns the information whether the named (by its enum-value) attribute is within the current list. More... | |
virtual bool | hasAttribute (const std::string &id) const =0 |
Returns the information whether the named attribute is within the current list. More... | |
virtual bool | getBool (int id) const =0 |
Returns the bool-value of the named (by its enum-value) attribute. More... | |
virtual int | getInt (int id) const =0 |
Returns the int-value of the named (by its enum-value) attribute. More... | |
virtual long long int | getLong (int id) const =0 |
Returns the long-value of the named (by its enum-value) attribute. More... | |
virtual std::string | getString (int id) const =0 |
Returns the string-value of the named (by its enum-value) attribute. More... | |
virtual std::string | getStringSecure (int id, const std::string &def) const =0 |
Returns the string-value of the named (by its enum-value) attribute. More... | |
virtual double | getFloat (int id) const =0 |
Returns the double-value of the named (by its enum-value) attribute. More... | |
virtual double | getFloat (const std::string &id) const =0 |
Returns the double-value of the named attribute. More... | |
virtual std::string | getStringSecure (const std::string &id, const std::string &def) const =0 |
Returns the string-value of the named (by its enum-value) attribute. More... | |
virtual SumoXMLEdgeFunc | getEdgeFunc (bool &ok) const =0 |
Returns the value of the named attribute. More... | |
virtual SumoXMLNodeType | getNodeType (bool &ok) const =0 |
Returns the value of the named attribute. More... | |
virtual RightOfWay | getRightOfWay (bool &ok) const =0 |
Returns the right-of-way method. More... | |
virtual FringeType | getFringeType (bool &ok) const =0 |
returns fringe type More... | |
virtual RGBColor | getColor () const =0 |
Returns the value of the named attribute. More... | |
virtual PositionVector | getShape (int attr) const =0 |
Tries to read given attribute assuming it is a PositionVector. More... | |
virtual Boundary | getBoundary (int attr) const =0 |
Tries to read given attribute assuming it is a Boundary. More... | |
const std::vector< std::string > | getStringVector (int attr) const |
Tries to read given attribute assuming it is a string vector. More... | |
const std::vector< std::string > | getOptStringVector (int attr, const char *objectid, bool &ok, bool report=true) const |
convenience function to avoid the default argument and the template stuff at getOpt<> More... | |
const std::vector< int > | getIntVector (int attr) const |
Tries to read given attribute assuming it is an int vector. More... | |
const std::vector< int > | getOptIntVector (int attr, const char *objectid, bool &ok, bool report=true) const |
convenience function to avoid the default argument and the template stuff at getOpt<> More... | |
virtual std::string | getName (int attr) const =0 |
Converts the given attribute id into a man readable string. More... | |
virtual void | serialize (std::ostream &os) const =0 |
Prints all attribute names and values into the given stream. More... | |
virtual std::vector< std::string > | getAttributeNames () const =0 |
Retrieves all attribute names. More... | |
const std::string & | getObjectType () const |
return the objecttype to which these attributes belong More... | |
virtual SUMOSAXAttributes * | clone () const =0 |
return a new deep-copy attributes object More... | |
std::ostream & | operator<< (std::ostream &os, const SUMOSAXAttributes &src) |
template<typename T > | |
T | getInternal (const int attr) const |
void | emitUngivenError (const std::string &attrname, const char *objectid) const |
void | emitEmptyError (const std::string &attrname, const char *objectid) const |
void | emitFormatError (const std::string &attrname, const std::string &type, const char *objectid) const |
SUMOSAXAttributes (const SUMOSAXAttributes &src) | |
Invalidated copy constructor. More... | |
SUMOSAXAttributes & | operator= (const SUMOSAXAttributes &src) |
Invalidated assignment operator. More... | |
Encapsulated SAX-Attributes.
This class is an interface for using encapsulated SAX-attributes. Encapsulation is done to allow a common acces without the need to import all the Xerces-definitions.
Definition at line 56 of file SUMOSAXAttributes.h.
SUMOSAXAttributes::SUMOSAXAttributes | ( | const std::string & | objectType | ) |
Definition at line 46 of file SUMOSAXAttributes.cpp.
|
inlinevirtual |
Destructor.
Definition at line 65 of file SUMOSAXAttributes.h.
|
private |
Invalidated copy constructor.
|
pure virtual |
return a new deep-copy attributes object
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by MSStateHandler::myStartElement().
|
protected |
Definition at line 161 of file SUMOSAXAttributes.cpp.
References myObjectType, and WRITE_ERROR.
Referenced by get(), getOpt(), getOptSUMOTimeReporting(), and getSUMOTimeReporting().
|
protected |
Definition at line 175 of file SUMOSAXAttributes.cpp.
References myObjectType, and WRITE_ERROR.
Referenced by get(), getOpt(), getOptSUMOTimeReporting(), and getSUMOTimeReporting().
|
protected |
Definition at line 147 of file SUMOSAXAttributes.cpp.
References myObjectType, and WRITE_ERROR.
Referenced by get(), and getSUMOTimeReporting().
T SUMOSAXAttributes::get | ( | int | attr, |
const char * | objectid, | ||
bool & | ok, | ||
bool | report = true |
||
) | const |
Tries to read given attribute assuming it is an int.
If an error occurs (the attribute is not there, it is not numeric), "ok" is set to false. If report is true an error message is written to MsgHandler::getErrorInstance.
If the value could be read, "ok" is not changed, and the value is returned.
[in] | attr | The id of the attribute to read |
[in] | objectid | The name of the parsed object; used for error message generation |
[out] | ok | Whether the value could be read |
[in] | report | Whether errors shall be written to msg handler's error instance |
Definition at line 492 of file SUMOSAXAttributes.h.
References emitEmptyError(), emitFormatError(), emitUngivenError(), getName(), and hasAttribute().
Referenced by NIXMLPTHandler::addAccess(), NIImporter_SUMO::addConnection(), NLHandler::addConnection(), NIXMLConnectionsHandler::addCrossing(), NLHandler::addDistrict(), NLHandler::addDistrictEdge(), NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addE3Entry(), NLHandler::addE3Exit(), NIImporter_SUMO::addEdge(), NIXMLEdgesHandler::addEdge(), NLHandler::addEdgeLaneMeanData(), NLHandler::addInstantE1Detector(), NIXMLNodesHandler::addJoinCluster(), NIXMLNodesHandler::addJoinExclusion(), NIImporter_SUMO::addJunction(), NIImporter_SUMO::addLane(), NLHandler::addLane(), NIXMLEdgesHandler::addLane(), NIXMLNodesHandler::addNode(), RONetHandler::addParam(), NLHandler::addParam(), SUMORouteHandler::addParam(), RORouteHandler::addPersonTrip(), NIImporter_SUMO::addPhase(), NLHandler::addPhase(), ShapeHandler::addPOI(), ShapeHandler::addPoly(), NIXMLPTHandler::addPTLine(), NIXMLPTHandler::addPTLineStop(), NIXMLPTHandler::addPTStop(), NIImporter_SUMO::addRequest(), NLHandler::addRequest(), NLHandler::addRouteProbeDetector(), NIXMLEdgesHandler::addSplit(), ROJTRTurnDefLoader::addToEdge(), NLHandler::addVTypeProbeDetector(), MSRouteHandler::addWalk(), RORouteHandler::addWalk(), NIXMLConnectionsHandler::addWalkingArea(), NLHandler::addWAUTJunction(), NLHandler::addWAUTSwitch(), NLHandler::beginE3Detector(), NLHandler::beginEdgeParsing(), ROJTRTurnDefLoader::beginFromEdge(), SUMOVehicleParserHelper::beginVTypeParsing(), NLTriggerBuilder::buildVaporizer(), NIXMLEdgesHandler::deleteEdge(), NIXMLNodesHandler::deleteNode(), NLTriggerBuilder::getLane(), NLTriggerBuilder::getPosition(), NLHandler::initJunctionLogic(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NLHandler::initTrafficLightLogic(), NIImporter_SUMO::loadLocation(), RODFDetectorHandler::myStartElement(), GUISettingsHandler::myStartElement(), NIXMLTypesHandler::myStartElement(), PCTypeDefHandler::myStartElement(), NIXMLTrafficLightsHandler::myStartElement(), MSStateHandler::myStartElement(), NIXMLConnectionsHandler::myStartElement(), ODAmitranHandler::myStartElement(), MSRouteHandler::myStartElement(), RONetHandler::myStartElement(), ShapeHandler::myStartElement(), ROJTRTurnDefLoader::myStartElement(), RORouteHandler::myStartElement(), PCNetProjectionLoader::myStartElement(), NIXMLPTHandler::myStartElement(), TrajectoriesHandler::myStartElement(), NIXMLNodesHandler::myStartElement(), NIXMLEdgesHandler::myStartElement(), PCLoaderXML::myStartElement(), NIImporter_MATSim::NodesHandler::myStartElement(), NIImporter_SUMO::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myStartElement(), NLHandler::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Zuflussdefinition::myStartElement(), PCLoaderOSM::NodesHandler::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Parkplatzdefinition::myStartElement(), PCLoaderOSM::RelationsHandler::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Fahrzeugklassendefinition::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_VWunschentscheidungsdefinition::myStartElement(), PCLoaderOSM::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::NodesHandler::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Routenentscheidungsdefinition::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_ConflictArea::myStartElement(), NIImporter_OpenStreetMap::RelationHandler::myStartElement(), NIImporter_OpenDrive::myStartElement(), ODDistrictHandler::openDistrict(), NLHandler::openJunction(), MSRouteHandler::openRoute(), RORouteHandler::openRoute(), MSRouteHandler::openRouteDistribution(), RORouteHandler::openRouteDistribution(), MSRouteHandler::openVehicleTypeDistribution(), RORouteHandler::openVehicleTypeDistribution(), NLHandler::openWAUT(), RONetHandler::parseAccess(), NLTriggerBuilder::parseAndAddLotEntry(), NLTriggerBuilder::parseAndBeginParkingArea(), GNEAdditionalHandler::parseAndBuildAccess(), NLTriggerBuilder::parseAndBuildCalibrator(), GNEAdditionalHandler::parseAndBuildCalibratorFlow(), NLTriggerBuilder::parseAndBuildChargingStation(), GNEAdditionalHandler::parseAndBuildDetectorEntry(), GNEAdditionalHandler::parseAndBuildDetectorExit(), NLTriggerBuilder::parseAndBuildLaneSpeedTrigger(), GNEAdditionalHandler::parseAndBuildParkingSpace(), NLTriggerBuilder::parseAndBuildRerouter(), GNEAdditionalHandler::parseAndBuildRerouterClosingLaneReroute(), GNEAdditionalHandler::parseAndBuildRerouterClosingReroute(), GNEAdditionalHandler::parseAndBuildRerouterDestProbReroute(), GNEAdditionalHandler::parseAndBuildRerouterInterval(), GNEAdditionalHandler::parseAndBuildRerouterParkingAreaReroute(), GNEAdditionalHandler::parseAndBuildRerouterRouteProbReroute(), NLTriggerBuilder::parseAndBuildStoppingPlace(), GNEAdditionalHandler::parseAndBuildTAZ(), GNEAdditionalHandler::parseAndBuildTAZSink(), GNEAdditionalHandler::parseAndBuildTAZSource(), GNEAdditionalHandler::parseAndBuildVariableSpeedSignStep(), GNEAttributeCarrier::parseAttributeFromXML(), SUMOVehicleParserHelper::parseCommonAttributes(), RONetHandler::parseConnection(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), RONetHandler::parseDistrict(), RONetHandler::parseDistrictEdge(), RONetHandler::parseEdge(), SUMOVehicleParserHelper::parseFlowAttributes(), RORouteHandler::parseFromViaTo(), SUMOVehicleParserHelper::parseID(), SUMOVehicleParserHelper::parseJMParams(), RONetHandler::parseJunction(), RONetHandler::parseLane(), NIXMLConnectionsHandler::parseLaneDefinition(), SUMOVehicleParserHelper::parseLCParams(), GNEAttributeCarrier::parseMaskedPositionAttribute(), GNEAdditionalHandler::parseParameter(), AGActivityGenHandler::parseStation(), SUMORouteHandler::parseStop(), parseStopOffsets(), RONetHandler::parseStoppingPlace(), ODDistrictHandler::parseTAZ(), SUMOVehicleParserHelper::parseVehicleAttributes(), SUMOVehicleParserHelper::parseVTypeEmbedded(), MSRouteHandler::parseWalkPositions(), NIXMLNodesHandler::processNodeType(), NIImporter_SUMO::readPosition(), NIXMLTrafficLightsHandler::removeTlConnection(), NIXMLTrafficLightsHandler::retrieveEdge(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), RONetHandler::setLocation(), NLHandler::setLocation(), and NIXMLEdgesHandler::setNodes().
|
pure virtual |
Retrieves all attribute names.
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by GUINet::DiscoverAttributes::myStartElement().
|
pure virtual |
Returns the bool-value of the named (by its enum-value) attribute.
Tries to retrieve the attribute from the the attribute list. The retrieved attribute (which may be 0) is then parsed using TplConvert<XMLCh>::_2bool. If the attribute is empty or ==0, TplConvert<XMLCh>::_2bool throws an EmptyData-exception which is passed. If the value can not be parsed to a bool, TplConvert<XMLCh>::_2bool throws a BoolFormatException-exception which is passed.
[in] | id | The id of the attribute to return the value of |
EmptyData | If the attribute is not known or the attribute value is an empty string |
BoolFormatException | If the attribute value can not be parsed to a bool |
Implemented in SUMOSAXAttributesImpl_Cached, SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
|
pure virtual |
Tries to read given attribute assuming it is a Boundary.
[in] | attr | The id of the attribute to read |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
|
pure virtual |
Returns the value of the named attribute.
Tries to retrieve the attribute from the the attribute list.
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
|
pure virtual |
Returns the value of the named attribute.
Tries to retrieve the attribute from the the attribute list.
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by NIImporter_SUMO::addEdge(), NLHandler::beginEdgeParsing(), and RONetHandler::parseEdge().
|
pure virtual |
Returns the double-value of the named attribute.
Tries to retrieve the attribute from the the attribute list. The retrieved attribute (which may be 0) is then parsed using TplConvert<XMLCh>::_2double. If the attribute is empty or ==0, TplConvert<XMLCh>::_2double throws an EmptyData-exception which is passed. If the value can not be parsed to a double, TplConvert<XMLCh>::_2double throws a NumberFormatException-exception which is passed.
[in] | id | The name of the attribute to return the value of |
EmptyData | If the attribute is not known or the attribute value is an empty string |
NumberFormatException | If the attribute value can not be parsed to an double |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
|
pure virtual |
Returns the double-value of the named (by its enum-value) attribute.
Tries to retrieve the attribute from the the attribute list. The retrieved attribute (which may be 0) is then parsed using TplConvert<XMLCh>::_2double. If the attribute is empty or ==0, TplConvert<XMLCh>::_2double throws an EmptyData-exception which is passed. If the value can not be parsed to a double, TplConvert<XMLCh>::_2double throws a NumberFormatException-exception which is passed.
[in] | id | The id of the attribute to return the value of |
EmptyData | If the attribute is not known or the attribute value is an empty string |
NumberFormatException | If the attribute value can not be parsed to an double |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by NIImporter_SUMO::addLane(), MSStateHandler::closeVehicle(), MSVehicle::loadState(), MSStateHandler::myStartElement(), TrajectoriesHandler::myStartElement(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseCityGates(), AGActivityGenHandler::parseClosingHour(), AGActivityGenHandler::parseOpeningHour(), AGActivityGenHandler::parseSchool(), AGActivityGenHandler::parseStreets(), and SAXWeightsHandler::tryParse().
|
pure virtual |
returns fringe type
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by NIImporter_SUMO::addJunction(), and NIXMLNodesHandler::processNodeType().
|
pure virtual |
Returns the int-value of the named (by its enum-value) attribute.
Tries to retrieve the attribute from the the attribute list. The retrieved attribute (which may be 0) is then parsed using TplConvert<XMLCh>::_2int. If the attribute is empty or ==0, TplConvert<XMLCh>::_2int throws an EmptyData-exception which is passed. If the value can not be parsed to an int, TplConvert<XMLCh>::_2int throws a NumberFormatException-exception which is passed.
[in] | id | The id of the attribute to return the value of |
EmptyData | If the attribute is not known or the attribute value is an empty string |
NumberFormatException | If the attribute value can not be parsed to an int |
Implemented in SUMOSAXAttributesImpl_Cached, SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by MSStateHandler::myStartElement(), AGActivityGenHandler::parseBracket(), AGActivityGenHandler::parseBusLine(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseClosingHour(), AGActivityGenHandler::parseFrequency(), AGActivityGenHandler::parseGeneralCityInfo(), AGActivityGenHandler::parseOpeningHour(), and AGActivityGenHandler::parseSchool().
std::vector< int > SUMOSAXAttributes::getInternal | ( | const int | attr | ) | const |
Definition at line 53 of file SUMOSAXAttributes.cpp.
References getString().
|
protected |
const std::vector< int > SUMOSAXAttributes::getIntVector | ( | int | attr | ) | const |
Tries to read given attribute assuming it is an int vector.
The behavior is similar to Python's string.split(), so multiple consecutive whitespace do not generate empty strings and leading and trailing whitespace is silently omitted.
[in] | attr | The id of the attribute to read |
Definition at line 128 of file SUMOSAXAttributes.cpp.
References getString(), StringTokenizer::getVector(), and StringUtils::toInt().
|
pure virtual |
Returns the long-value of the named (by its enum-value) attribute.
Tries to retrieve the attribute from the the attribute list. The retrieved attribute (which may be 0) is then parsed using TplConvert<XMLCh>::_2long. If the attribute is empty or ==0, TplConvert<XMLCh>::_2long throws an EmptyData-exception which is passed. If the value can not be parsed to a long, TplConvert<XMLCh>::_2long throws a NumberFormatException-exception which is passed.
[in] | id | The id of the attribute to return the value of |
EmptyData | If the attribute is not known or the attribute value is an empty string |
NumberFormatException | If the attribute value can not be parsed to an int |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Cached, and SUMOSAXAttributesImpl_Xerces.
Referenced by MSVehicleTransfer::loadState().
|
pure virtual |
Converts the given attribute id into a man readable string.
[in] | attr | The id of the attribute to return the name of |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by get(), getOpt(), getOptSUMOTimeReporting(), getSUMOTimeReporting(), and SUMOVehicleParserHelper::parseFlowAttributes().
|
pure virtual |
Returns the value of the named attribute.
Tries to retrieve the attribute from the the attribute list.
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by NIImporter_SUMO::addJunction(), NLHandler::openJunction(), and RONetHandler::parseJunction().
|
inline |
return the objecttype to which these attributes belong
Definition at line 396 of file SUMOSAXAttributes.h.
References myObjectType.
Referenced by GNERouteHandler::addPersonTrip(), SUMOSAXAttributesImpl_Cached::clone(), SUMOSAXAttributesImpl_Xerces::clone(), SUMOSAXAttributesImpl_Binary::clone(), SUMOVehicleParserHelper::parseGuiShape(), ODDistrictHandler::parseTAZ(), and SUMOVehicleParserHelper::parseVehicleClass().
T SUMOSAXAttributes::getOpt | ( | int | attr, |
const char * | objectid, | ||
bool & | ok, | ||
T | defaultValue, | ||
bool | report = true |
||
) | const |
Tries to read given attribute assuming it is an int.
If the attribute is not existing in the current element, the default value is returned. If an error occurs on parsing (the attribute is empty, it is not numeric), "ok" is set to false. If report is true an error message is written to MsgHandler::getErrorInstance.
If the value could be read, "ok" is not changed, and the value is returned.
[in] | attr | The id of the attribute to read |
[in] | objectid | The name of the parsed object; used for error message generation |
[out] | ok | Whether the value could be read |
[in] | defaultValue | The value to return if the attribute is not within the element |
[in] | report | Whether errors shall be written to msg handler's error instance |
Definition at line 518 of file SUMOSAXAttributes.h.
References emitEmptyError(), emitFormatError(), getName(), and hasAttribute().
Referenced by NIXMLPTHandler::addAccess(), NLTriggerBuilder::addAccess(), NLDiscreteEventBuilder::addAction(), NIImporter_SUMO::addConnection(), NLHandler::addConnection(), NIXMLConnectionsHandler::addCrossing(), NLHandler::addDistrict(), NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addE3Entry(), NLHandler::addE3Exit(), NIImporter_SUMO::addEdge(), NIXMLEdgesHandler::addEdge(), NLHandler::addEdgeLaneMeanData(), NLHandler::addInstantE1Detector(), NIXMLNodesHandler::addJoinCluster(), NIImporter_SUMO::addJunction(), NIImporter_SUMO::addLane(), NLHandler::addLane(), NIXMLEdgesHandler::addLane(), MSRouteHandler::addPersonTrip(), RORouteHandler::addPersonTrip(), NIImporter_SUMO::addPhase(), NLHandler::addPhase(), ShapeHandler::addPOI(), ShapeHandler::addPoly(), NIImporter_SUMO::addProhibition(), NIXMLPTHandler::addPTLine(), NIXMLPTHandler::addPTStop(), NLHandler::addRequest(), NLHandler::addRouteProbeDetector(), NIXMLEdgesHandler::addSplit(), MSRouteHandler::addStop(), RORouteHandler::addStop(), GNERouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), MSRouteHandler::addWalk(), RORouteHandler::addWalk(), NIXMLConnectionsHandler::addWalkingArea(), NLHandler::addWAUTJunction(), NLHandler::beginE3Detector(), NLHandler::beginEdgeParsing(), SUMOVehicleParserHelper::beginVTypeParsing(), NLDiscreteEventBuilder::buildSaveTLSProgramCommand(), NLDiscreteEventBuilder::buildSaveTLStateCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchesCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchStatesCommand(), NIXMLEdgesHandler::deleteEdge(), NLTriggerBuilder::getFileName(), NLTriggerBuilder::getPosition(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NLHandler::initTrafficLightLogic(), RODFDetectorHandler::myStartElement(), GUISettingsHandler::myStartElement(), PCTypeDefHandler::myStartElement(), NIXMLTypesHandler::myStartElement(), MSStateHandler::myStartElement(), NIXMLConnectionsHandler::myStartElement(), MSRouteHandler::myStartElement(), RORouteHandler::myStartElement(), TrajectoriesHandler::myStartElement(), PCLoaderXML::myStartElement(), NIImporter_SUMO::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSCalibrator::myStartElement(), NLHandler::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), PCLoaderOSM::NodesHandler::myStartElement(), SAXWeightsHandler::myStartElement(), MSTriggeredRerouter::myStartElement(), PCLoaderOSM::RelationsHandler::myStartElement(), PCLoaderOSM::EdgesHandler::myStartElement(), NIImporter_OpenDrive::myStartElement(), NLHandler::openJunction(), MSRouteHandler::openRoute(), RORouteHandler::openRoute(), RORouteHandler::openRouteDistribution(), RONetHandler::parseAccess(), NLTriggerBuilder::parseAndAddLotEntry(), NLTriggerBuilder::parseAndBeginParkingArea(), NLTriggerBuilder::parseAndBuildCalibrator(), NLTriggerBuilder::parseAndBuildChargingStation(), GNEAdditionalHandler::parseAndBuildPoly(), NLTriggerBuilder::parseAndBuildRerouter(), GNEAdditionalHandler::parseAndBuildRerouter(), NLTriggerBuilder::parseAndBuildStoppingPlace(), SUMOVehicleParserHelper::parseCommonAttributes(), RONetHandler::parseConnection(), RONetHandler::parseEdge(), MSRouteHandler::parseFromViaTo(), RORouteHandler::parseFromViaTo(), AGActivityGenHandler::parseGeneralCityInfo(), SUMOVehicleParserHelper::parseGuiShape(), RONetHandler::parseJunction(), RONetHandler::parseLane(), NIXMLConnectionsHandler::parseLaneBound(), AGActivityGenHandler::parseParameters(), SUMORouteHandler::parseStop(), parseStopOffsets(), RONetHandler::parseStoppingPlace(), SUMOVehicleParserHelper::parseVehicleAttributes(), SUMOVehicleParserHelper::parseVehicleClass(), MSRouteHandler::parseWalkPositions(), NIXMLNodesHandler::processNodeType(), NIXMLNodesHandler::processTrafficLightDefinitions(), NIImporter_SUMO::readPosition(), NIXMLEdgesHandler::tryGetLaneSpread(), and NIXMLEdgesHandler::tryGetShape().
const std::vector< int > SUMOSAXAttributes::getOptIntVector | ( | int | attr, |
const char * | objectid, | ||
bool & | ok, | ||
bool | report = true |
||
) | const |
convenience function to avoid the default argument and the template stuff at getOpt<>
Definition at line 142 of file SUMOSAXAttributes.cpp.
Referenced by NIImporter_SUMO::addPhase(), and NLHandler::addPhase().
const std::vector< std::string > SUMOSAXAttributes::getOptStringVector | ( | int | attr, |
const char * | objectid, | ||
bool & | ok, | ||
bool | report = true |
||
) | const |
convenience function to avoid the default argument and the template stuff at getOpt<>
Definition at line 123 of file SUMOSAXAttributes.cpp.
Referenced by NIXMLEdgesHandler::addSplit(), NLTriggerBuilder::parseAndBeginParkingArea(), NLTriggerBuilder::parseAndBuildStoppingPlace(), SUMORouteHandler::parseStop(), and NIXMLNodesHandler::processTrafficLightDefinitions().
SUMOTime SUMOSAXAttributes::getOptSUMOTimeReporting | ( | int | attr, |
const char * | objectid, | ||
bool & | ok, | ||
SUMOTime | defaultValue, | ||
bool | report = true |
||
) | const |
Tries to read given attribute assuming it is a SUMOTime.
If the attribute is not existing in the current element, the default value is returned. If an error occurs on parsing (the attribute is empty, it is not numeric), "ok" is set to false. If report is true an error message is written to MsgHandler::getErrorInstance.
Otherwise, "ok" is not changed.
In dependence to the used time representation, either get<int> or get<double> is used.
[in] | attr | The id of the attribute to read |
[in] | objectid | The name of the parsed object; used for error message generation |
[out] | ok | Whether the value could be read |
[in] | defaultValue | The value to return if the attribute is not within the element |
[in] | report | Whether errors shall be written to msg handler's error instance |
Definition at line 90 of file SUMOSAXAttributes.cpp.
References emitEmptyError(), emitFormatError(), getName(), hasAttribute(), and string2time().
Referenced by NLHandler::addE2Detector(), NLHandler::addEdgeLaneMeanData(), MSRouteHandler::addPersonTrip(), NIImporter_SUMO::addPhase(), NLHandler::addPhase(), NLHandler::addRouteProbeDetector(), MSRouteHandler::addWalk(), NLHandler::beginE3Detector(), NLHandler::initTrafficLightLogic(), GUISettingsHandler::myStartElement(), MSRouteHandler::myStartElement(), MSCalibrator::myStartElement(), MSTriggeredRerouter::myStartElement(), NLHandler::openWAUT(), NLTriggerBuilder::parseAndBuildCalibrator(), and SUMORouteHandler::parseStop().
|
pure virtual |
Returns the right-of-way method.
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by NIImporter_SUMO::addJunction(), and NIXMLNodesHandler::processNodeType().
|
pure virtual |
Tries to read given attribute assuming it is a PositionVector.
[in] | attr | The id of the attribute to read |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
|
pure virtual |
Returns the string-value of the named (by its enum-value) attribute.
Tries to retrieve the attribute from the the attribute list. The retrieved attribute (which may be 0) is then parsed using TplConvert<XMLCh>::_2str. If the attribute is ==0, TplConvert<XMLCh>::_2str throws an EmptyData-exception which is passed.
[in] | id | The id of the attribute to return the value of |
EmptyData | If the attribute is not known or the attribute value is an empty string |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by RONetHandler::addParam(), NLHandler::addParam(), SUMORouteHandler::addParam(), getInternal(), getIntVector(), getStringVector(), MSTransportableDevice_Routing::loadState(), MSVehicleTransfer::loadState(), MSDevice_Routing::loadState(), MSDevice_Vehroutes::loadState(), MSDevice_Tripinfo::loadState(), MEVehicle::loadState(), MSVehicle::loadState(), ROMARouteHandler::myStartElement(), NIXMLTrafficLightsHandler::myStartElement(), MSStateHandler::myStartElement(), ShapeHandler::myStartElement(), NIXMLPTHandler::myStartElement(), TrajectoriesHandler::myStartElement(), NIXMLNodesHandler::myStartElement(), NIXMLEdgesHandler::myStartElement(), NIImporter_SUMO::myStartElement(), NLHandler::myStartElement(), GNEParametersDialog::ParametersOptions::GNEParameterHandler::myStartElement(), AGActivityGenHandler::parseBusLine(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseCityGates(), GNEAdditionalHandler::parseParameter(), AGActivityGenHandler::parseSchool(), and AGActivityGenHandler::parseStreets().
|
pure virtual |
Returns the string-value of the named (by its enum-value) attribute.
Tries to retrieve the attribute from the the attribute list. If the attribute is ==0, TplConvert<XMLCh>::_2strSec returns the default value.
[in] | id | The name of the attribute to return the value of |
[in] | def | The default value to return if the attribute is not in attributes |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
|
pure virtual |
Returns the string-value of the named (by its enum-value) attribute.
Tries to retrieve the attribute from the the attribute list. The retrieved attribute (which may be 0) is then parsed using TplConvert<XMLCh>::_2strSec. If the attribute is ==0, TplConvert<XMLCh>::_2strSec returns the default value.
[in] | id | The id of the attribute to return the value of |
[in] | def | The default value to return if the attribute is not in attributes |
EmptyData | If the attribute is not known or the attribute value is an empty string |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by NIXMLEdgesHandler::addEdge(), NLHandler::addPhase(), NIXMLPTHandler::addPTLine(), NLHandler::addVTypeProbeDetector(), GUISettingsHandler::myStartElement(), MSTriggeredRerouter::myStartElement(), PCLoaderOSM::RelationsHandler::myStartElement(), PCLoaderOSM::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::NodesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::RelationHandler::myStartElement(), NLHandler::openJunction(), GUISettingsHandler::parseSizeSettings(), and GUISettingsHandler::parseTextSettings().
const std::vector< std::string > SUMOSAXAttributes::getStringVector | ( | int | attr | ) | const |
Tries to read given attribute assuming it is a string vector.
The behavior is similar to Python's string.split(), so multiple consecutive whitespace do not generate empty strings and leading and trailing whitespace is silently omitted.
[in] | attr | The id of the attribute to read |
Definition at line 113 of file SUMOSAXAttributes.cpp.
References getString(), and StringTokenizer::getVector().
Referenced by NLHandler::addDistrict(), NIImporter_SUMO::addRoundabout(), NLHandler::addRoundabout(), NIXMLEdgesHandler::addRoundabout(), NIXMLPTHandler::addRoute(), MSStateHandler::myStartElement(), ODDistrictHandler::openDistrict(), and RONetHandler::parseDistrict().
SUMOTime SUMOSAXAttributes::getSUMOTimeReporting | ( | int | attr, |
const char * | objectid, | ||
bool & | ok, | ||
bool | report = true |
||
) | const |
Tries to read given attribute assuming it is a SUMOTime.
If an error occurs (the attribute is not there, it is not numeric), "ok" is set to false and an error message is written to MsgHandler::getErrorInstance.
Otherwise, "ok" is not changed.
In dependence to the used time representation, either get<int> or get<double> is used.
[in] | attr | The id of the attribute to read |
[in] | objectid | The name of the parsed object; used for error message generation |
[out] | ok | Whether the value could be read |
[in] | report | Whether errors shall be written to msg handler's error instance |
Definition at line 63 of file SUMOSAXAttributes.cpp.
References emitEmptyError(), emitFormatError(), emitUngivenError(), getName(), hasAttribute(), and string2time().
Referenced by NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addPhase(), NLHandler::addRouteProbeDetector(), NLHandler::addVTypeProbeDetector(), NLHandler::addWAUTSwitch(), NLHandler::beginE3Detector(), SUMOVehicleParserHelper::beginVTypeParsing(), NLTriggerBuilder::buildVaporizer(), GUISettingsHandler::myStartElement(), TrajectoriesHandler::myStartElement(), SUMORouteHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSCalibrator::myStartElement(), SAXWeightsHandler::myStartElement(), GUINet::DiscoverAttributes::myStartElement(), and SUMOVehicleParserHelper::parseFlowAttributes().
|
pure virtual |
Returns the information whether the named attribute is within the current list.
[in] | id | The name of the attribute to search for |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
|
pure virtual |
Returns the information whether the named (by its enum-value) attribute is within the current list.
[in] | id | The id of the attribute to search for |
Implemented in SUMOSAXAttributesImpl_Cached, SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by NIXMLConnectionsHandler::addCrossing(), NLHandler::addDistrict(), NIXMLEdgesHandler::addEdge(), NIXMLNodesHandler::addJoinCluster(), NIImporter_SUMO::addJunction(), NIImporter_SUMO::addLane(), NIXMLEdgesHandler::addLane(), NIXMLNodesHandler::addNode(), RONetHandler::addParam(), NLHandler::addParam(), SUMORouteHandler::addParam(), MSRouteHandler::addPersonTrip(), RORouteHandler::addPersonTrip(), GNERouteHandler::addPersonTrip(), NLHandler::addPhase(), ShapeHandler::addPOI(), ShapeHandler::addPoly(), NIXMLPTHandler::addPTLine(), GNERouteHandler::addRide(), NIImporter_SUMO::addRoundabout(), NLHandler::addRoundabout(), NIXMLEdgesHandler::addRoundabout(), NIXMLEdgesHandler::addSplit(), MSRouteHandler::addStop(), GNERouteHandler::addStop(), MSRouteHandler::addWalk(), RORouteHandler::addWalk(), GNERouteHandler::addWalk(), NIXMLConnectionsHandler::addWalkingArea(), SUMOVehicleParserHelper::beginVTypeParsing(), get(), getOpt(), getOptSUMOTimeReporting(), getSUMOTimeReporting(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), MSVehicleTransfer::loadState(), MEVehicle::loadState(), MSVehicle::loadState(), ROMARouteHandler::myStartElement(), NIXMLTypesHandler::myStartElement(), NIXMLTrafficLightsHandler::myStartElement(), MSStateHandler::myStartElement(), NIXMLConnectionsHandler::myStartElement(), MSRouteHandler::myStartElement(), ROJTRTurnDefLoader::myStartElement(), ShapeHandler::myStartElement(), RORouteHandler::myStartElement(), NIXMLPTHandler::myStartElement(), TrajectoriesHandler::myStartElement(), SUMORouteHandler::myStartElement(), NIXMLNodesHandler::myStartElement(), NIXMLEdgesHandler::myStartElement(), NIImporter_SUMO::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), MSTriggeredRerouter::myStartElement(), GNEParametersDialog::ParametersOptions::GNEParameterHandler::myStartElement(), PCLoaderOSM::RelationsHandler::myStartElement(), PCLoaderOSM::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::NodesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::RelationHandler::myStartElement(), NIImporter_OpenDrive::myStartElement(), ODDistrictHandler::openDistrict(), NLHandler::openJunction(), MSRouteHandler::openRoute(), RORouteHandler::openRoute(), GNERouteHandler::openRoute(), MSRouteHandler::openRouteDistribution(), RORouteHandler::openRouteDistribution(), MSRouteHandler::openVehicleTypeDistribution(), RORouteHandler::openVehicleTypeDistribution(), GNEAdditionalHandler::parseAndBuildAccess(), NLTriggerBuilder::parseAndBuildCalibrator(), GNEAdditionalHandler::parseAndBuildCalibrator(), GNEAdditionalHandler::parseAndBuildChargingStation(), GNEAdditionalHandler::parseAndBuildDetectorE1(), GNEAdditionalHandler::parseAndBuildDetectorE1Instant(), GNEAdditionalHandler::parseAndBuildDetectorE2(), GNEAdditionalHandler::parseAndBuildDetectorE3(), GNEAdditionalHandler::parseAndBuildDetectorEntry(), GNEAdditionalHandler::parseAndBuildDetectorExit(), GNEAdditionalHandler::parseAndBuildParkingArea(), GNEAdditionalHandler::parseAndBuildParkingSpace(), GNEAdditionalHandler::parseAndBuildPOI(), GNEAdditionalHandler::parseAndBuildRerouter(), GNEAdditionalHandler::parseAndBuildRouteProbe(), GNEAdditionalHandler::parseAndBuildTAZ(), GNEAdditionalHandler::parseAndBuildVaporizer(), GNEAdditionalHandler::parseAndBuildVariableSpeedSign(), GNEAttributeCarrier::parseAttributeFromXML(), SUMOVehicleParserHelper::parseCommonAttributes(), RONetHandler::parseDistrict(), SUMOVehicleParserHelper::parseFlowAttributes(), MSRouteHandler::parseFromViaTo(), RORouteHandler::parseFromViaTo(), SUMOVehicleParserHelper::parseID(), SUMOVehicleParserHelper::parseJMParams(), NIXMLConnectionsHandler::parseLaneBound(), NIXMLConnectionsHandler::parseLaneInfo(), SUMOVehicleParserHelper::parseLCParams(), GNEAttributeCarrier::parseMaskedPositionAttribute(), GNEAdditionalHandler::parseParameter(), SUMORouteHandler::parseStop(), parseStopOffsets(), AGActivityGenHandler::parseStreets(), SUMOVehicleParserHelper::parseVTypeEmbedded(), MSRouteHandler::parseWalkPositions(), NIXMLNodesHandler::processNodeType(), NIXMLEdgesHandler::setNodes(), NIXMLEdgesHandler::tryGetShape(), and SAXWeightsHandler::tryParse().
|
private |
Invalidated assignment operator.
|
pure virtual |
Prints all attribute names and values into the given stream.
[in] | os | The stream to use |
Implemented in SUMOSAXAttributesImpl_Binary, SUMOSAXAttributesImpl_Xerces, and SUMOSAXAttributesImpl_Cached.
Referenced by operator<<().
|
friend |
Definition at line 429 of file SUMOSAXAttributes.h.
|
static |
The encoding of parsed strings.
Definition at line 407 of file SUMOSAXAttributes.h.
Referenced by OptionsCont::writeXMLHeader().
|
private |
the object type to use in error reporting
Definition at line 424 of file SUMOSAXAttributes.h.
Referenced by emitEmptyError(), emitFormatError(), emitUngivenError(), and getObjectType().