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<> | |
int | getInternal (const int attr) const |
template<> | |
SUMOLong | getInternal (const int attr) const |
template<> | |
SUMOReal | getInternal (const int attr) const |
template<> | |
bool | getInternal (const int attr) const |
template<> | |
std::string | getInternal (const int attr) const |
template<> | |
RGBColor | getInternal (const int attr) const |
template<> | |
PositionVector | getInternal (const int attr) const |
template<> | |
Boundary | 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... | |
static bool | myHaveInformedAboutDeprecatedDivider = false |
Information whether the usage of a deprecated divider was reported. 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 SUMOLong | 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 SUMOReal | getFloat (int id) const =0 |
Returns the SUMOReal-value of the named (by its enum-value) attribute. More... | |
virtual SUMOReal | getFloat (const std::string &id) const =0 |
Returns the SUMOReal-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 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... | |
virtual std::vector< std::string > | getStringVector (int attr) const =0 |
Tries to read given attribute assuming it is a string vector. More... | |
virtual std::vector< SUMOReal > | getFloatVector (int attr) const =0 |
Tries to read given attribute assuming it is a vector of floats. 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... | |
const std::string & | getObjectType () const |
return the objecttype to which these attributes belong More... | |
std::ostream & | operator<< (std::ostream &os, const SUMOSAXAttributes &src) |
static void | parseStringVector (const std::string &def, std::vector< std::string > &into) |
Splits the given string. More... | |
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 63 of file SUMOSAXAttributes.h.
SUMOSAXAttributes::SUMOSAXAttributes | ( | const std::string & | objectType | ) |
Definition at line 58 of file SUMOSAXAttributes.cpp.
|
inlinevirtual |
Destructor.
Definition at line 72 of file SUMOSAXAttributes.h.
|
private |
Invalidated copy constructor.
|
protected |
Definition at line 138 of file SUMOSAXAttributes.cpp.
References myObjectType, and WRITE_ERROR.
Referenced by get(), getOpt(), getOptSUMOTimeReporting(), and getSUMOTimeReporting().
|
protected |
Definition at line 154 of file SUMOSAXAttributes.cpp.
References myObjectType, and WRITE_ERROR.
Referenced by get(), getOpt(), getOptSUMOTimeReporting(), and getSUMOTimeReporting().
|
protected |
Definition at line 122 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 438 of file SUMOSAXAttributes.h.
References emitEmptyError(), emitFormatError(), emitUngivenError(), getName(), and hasAttribute().
Referenced by NIImporter_SUMO::addConnection(), NLHandler::addConnection(), 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(), NLHandler::addParam(), NIImporter_SUMO::addPhase(), NLHandler::addPhase(), NLHandler::addPOI(), NLHandler::addPoly(), NLHandler::addRequest(), NLHandler::addRouteProbeDetector(), NIXMLEdgesHandler::addSplit(), MSRouteHandler::addStop(), RORouteHandler::addStop(), ROJTRTurnDefLoader::addToEdge(), NLHandler::addVTypeProbeDetector(), 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(), PCTypeDefHandler::myStartElement(), NIXMLConnectionsHandler::myStartElement(), MSRouteHandler::myStartElement(), NIXMLTypesHandler::myStartElement(), ROJTRTurnDefLoader::myStartElement(), PCNetProjectionLoader::myStartElement(), PCLoaderXML::myStartElement(), NIImporter_MATSim::NodesHandler::myStartElement(), PCLoaderOSM::NodesHandler::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), SAXWeightsHandler::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(), MSRouteHandler::openRouteDistribution(), RORouteHandler::openRouteDistribution(), MSRouteHandler::openVehicleTypeDistribution(), RORouteHandler::openVehicleTypeDistribution(), NLHandler::openWAUT(), NLTriggerBuilder::parseAndBuildBusStop(), NLTriggerBuilder::parseAndBuildCalibrator(), NLTriggerBuilder::parseAndBuildLaneSpeedTrigger(), NLTriggerBuilder::parseAndBuildRerouter(), SUMOVehicleParserHelper::parseCommonAttributes(), RONetHandler::parseConnection(), ODDistrictHandler::parseConnection(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), RONetHandler::parseDistrict(), RONetHandler::parseDistrictEdge(), RONetHandler::parseEdge(), SUMOVehicleParserHelper::parseFlowAttributes(), RORouteHandler::parseFromTo(), RONetHandler::parseJunction(), RONetHandler::parseLane(), NIXMLConnectionsHandler::parseLaneDefinition(), AGActivityGenHandler::parseStation(), SUMOVehicleParserHelper::parseVehicleAttributes(), SUMOVehicleParserHelper::parseVTypeEmbedded(), NIImporter_SUMO::readPosition(), NIXMLTrafficLightsHandler::removeTlConnection(), NIXMLTrafficLightsHandler::retrieveEdge(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NLHandler::setLocation(), and NIXMLEdgesHandler::setNodes().
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_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by getInternal().
Tries to read given attribute assuming it is a Boundary.
[in] | attr | The id of the attribute to read |
Implemented in SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by getInternal().
|
pure virtual |
Returns the value of the named attribute.
Tries to retrieve the attribute from the the attribute list.
Implemented in SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by getInternal().
|
pure virtual |
Returns the value of the named attribute.
Tries to retrieve the attribute from the the attribute list.
Implemented in SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by NIImporter_SUMO::addEdge(), and NLHandler::beginEdgeParsing().
Returns the SUMOReal-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>::_2SUMOReal. If the attribute is empty or ==0, TplConvert<XMLCh>::_2SUMOReal throws an EmptyData-exception which is passed. If the value can not be parsed to a SUMOReal, TplConvert<XMLCh>::_2SUMOReal 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 SUMOReal |
Implemented in SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by NIImporter_SUMO::addLane(), getInternal(), getOptSUMOTimeReporting(), getSUMOTimeReporting(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseCityGates(), AGActivityGenHandler::parseClosingHour(), AGActivityGenHandler::parseOpeningHour(), AGActivityGenHandler::parseSchool(), AGActivityGenHandler::parseStreets(), and SAXWeightsHandler::tryParse().
|
pure virtual |
Returns the SUMOReal-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>::_2SUMOReal. If the attribute is empty or ==0, TplConvert<XMLCh>::_2SUMOReal throws an EmptyData-exception which is passed. If the value can not be parsed to a SUMOReal, TplConvert<XMLCh>::_2SUMOReal 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 SUMOReal |
Implemented in SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
Tries to read given attribute assuming it is a vector of floats.
[in] | attr | The id of the attribute to read |
Implemented in SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
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_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by getInternal(), AGActivityGenHandler::parseBracket(), AGActivityGenHandler::parseBusLine(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseClosingHour(), AGActivityGenHandler::parseFrequency(), AGActivityGenHandler::parseGeneralCityInfo(), AGActivityGenHandler::parseOpeningHour(), and AGActivityGenHandler::parseSchool().
Definition at line 187 of file SUMOSAXAttributes.cpp.
References getInt().
Definition at line 195 of file SUMOSAXAttributes.cpp.
References getLong().
Definition at line 203 of file SUMOSAXAttributes.cpp.
References getFloat().
Definition at line 211 of file SUMOSAXAttributes.cpp.
References getBool().
std::string SUMOSAXAttributes::getInternal | ( | const int | attr | ) | const |
Definition at line 219 of file SUMOSAXAttributes.cpp.
References getString().
Definition at line 231 of file SUMOSAXAttributes.cpp.
References getColor().
PositionVector SUMOSAXAttributes::getInternal | ( | const int | attr | ) | const |
Definition at line 239 of file SUMOSAXAttributes.cpp.
References getShape().
Definition at line 247 of file SUMOSAXAttributes.cpp.
References getBoundary().
|
protected |
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, and SUMOSAXAttributesImpl_Xerces.
Referenced by getInternal().
|
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, and SUMOSAXAttributesImpl_Xerces.
Referenced by get(), getOpt(), getOptSUMOTimeReporting(), getSUMOTimeReporting(), SUMOVehicleParserHelper::parseFlowAttributes(), and SUMOVehicleParserHelper::parseVehicleAttributes().
|
pure virtual |
Returns the value of the named attribute.
Tries to retrieve the attribute from the the attribute list.
Implemented in SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by NIImporter_SUMO::addJunction(), and NLHandler::openJunction().
|
inline |
return the objecttype to which these attributes belong
Definition at line 380 of file SUMOSAXAttributes.h.
References myObjectType.
Referenced by ODDistrictHandler::parseConnection(), SUMOVehicleParserHelper::parseEmissionClass(), SUMOVehicleParserHelper::parseGuiShape(), 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 464 of file SUMOSAXAttributes.h.
References emitEmptyError(), emitFormatError(), getName(), and hasAttribute().
Referenced by NLDiscreteEventBuilder::addAction(), NIImporter_SUMO::addConnection(), NLHandler::addConnection(), NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addE3Entry(), NLHandler::addE3Exit(), NIImporter_SUMO::addEdge(), NIXMLEdgesHandler::addEdge(), NLHandler::addEdgeLaneMeanData(), NLHandler::addInstantE1Detector(), NIImporter_SUMO::addJunction(), NIImporter_SUMO::addLane(), NLHandler::addLane(), NIXMLEdgesHandler::addLane(), NIXMLNodesHandler::addNode(), NLHandler::addPOI(), NLHandler::addPoly(), NIImporter_SUMO::addProhibition(), NLHandler::addRequest(), NIXMLEdgesHandler::addSplit(), MSRouteHandler::addStop(), RORouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NLHandler::addWAUTJunction(), NLHandler::beginE3Detector(), NLHandler::beginEdgeParsing(), NLDiscreteEventBuilder::buildSaveTLStateCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchesCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchStatesCommand(), NLTriggerBuilder::getFileName(), NLTriggerBuilder::getPosition(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NLHandler::initTrafficLightLogic(), RODFDetectorHandler::myStartElement(), GUISettingsHandler::myStartElement(), PCTypeDefHandler::myStartElement(), NIXMLConnectionsHandler::myStartElement(), MSRouteHandler::myStartElement(), MSCalibrator::myStartElement(), NIXMLTypesHandler::myStartElement(), PCLoaderXML::myStartElement(), MSLaneSpeedTrigger::myStartElement(), PCLoaderOSM::NodesHandler::myStartElement(), MSTriggeredRerouter::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), SAXWeightsHandler::myStartElement(), PCLoaderOSM::EdgesHandler::myStartElement(), NLHandler::openJunction(), MSRouteHandler::openRoute(), RORouteHandler::openRoute(), NLTriggerBuilder::parseAndBuildBusStop(), NLTriggerBuilder::parseAndBuildCalibrator(), NLTriggerBuilder::parseAndBuildRerouter(), SUMOVehicleParserHelper::parseCommonAttributes(), SUMOVehicleParserHelper::parseEmissionClass(), AGActivityGenHandler::parseGeneralCityInfo(), SUMOVehicleParserHelper::parseGuiShape(), RONetHandler::parseLane(), NIXMLConnectionsHandler::parseLaneBound(), AGActivityGenHandler::parseParameters(), SUMOVehicleParserHelper::parseVehicleAttributes(), SUMOVehicleParserHelper::parseVehicleClass(), NIXMLNodesHandler::processTrafficLightDefinitions(), NIXMLEdgesHandler::tryGetLaneSpread(), and NIXMLEdgesHandler::tryGetShape().
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<SUMOReal> 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 93 of file SUMOSAXAttributes.cpp.
References emitEmptyError(), emitFormatError(), getFloat(), getName(), and hasAttribute().
Referenced by NLHandler::addE2Detector(), NLHandler::addEdgeLaneMeanData(), NLHandler::addPhase(), NLHandler::addRouteProbeDetector(), MSRouteHandler::addStop(), RORouteHandler::addStop(), NLHandler::beginE3Detector(), NLHandler::initTrafficLightLogic(), GUISettingsHandler::myStartElement(), MSRouteHandler::myStartElement(), MSCalibrator::myStartElement(), MSTriggeredRerouter::myStartElement(), NLHandler::openWAUT(), and NLTriggerBuilder::parseAndBuildCalibrator().
|
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, and SUMOSAXAttributesImpl_Xerces.
Referenced by getInternal().
|
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, and SUMOSAXAttributesImpl_Xerces.
Referenced by getInternal(), AGActivityGenHandler::parseBusLine(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseCityGates(), 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. 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, and SUMOSAXAttributesImpl_Xerces.
Referenced by NIXMLEdgesHandler::addEdge(), NLHandler::addVTypeProbeDetector(), GUISettingsHandler::myStartElement(), MSTriggeredRerouter::myStartElement(), NIImporter_OpenStreetMap::NodesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::RelationHandler::myStartElement(), NLHandler::openJunction(), and GUISettingsHandler::parseTextSettings().
|
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, and SUMOSAXAttributesImpl_Xerces.
|
pure virtual |
Tries to read given attribute assuming it is a string vector.
[in] | attr | The id of the attribute to read |
Implemented in SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by NLHandler::addDistrict(), 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<SUMOReal> 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(), getFloat(), getName(), and hasAttribute().
Referenced by NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addPhase(), NLHandler::addRouteProbeDetector(), NLHandler::addVTypeProbeDetector(), NLHandler::addWAUTSwitch(), NLHandler::beginE3Detector(), NLTriggerBuilder::buildVaporizer(), MSCalibrator::myStartElement(), SUMORouteHandler::myStartElement(), ROJTRTurnDefLoader::myStartElement(), MSLaneSpeedTrigger::myStartElement(), SUMOVehicleParserHelper::parseFlowAttributes(), and SUMOVehicleParserHelper::parseVehicleAttributes().
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_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by NLHandler::addDistrict(), NIXMLEdgesHandler::addEdge(), NIImporter_SUMO::addJunction(), NIImporter_SUMO::addLane(), NIXMLEdgesHandler::addLane(), NIXMLNodesHandler::addNode(), NLHandler::addPOI(), MSRouteHandler::addStop(), RORouteHandler::addStop(), SUMOVehicleParserHelper::beginVTypeParsing(), get(), getOpt(), getOptSUMOTimeReporting(), getSUMOTimeReporting(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), MSRouteHandler::myStartElement(), NIXMLConnectionsHandler::myStartElement(), ROJTRTurnDefLoader::myStartElement(), PCLoaderXML::myStartElement(), NIImporter_MATSim::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(), MSRouteHandler::openRouteDistribution(), RORouteHandler::openRouteDistribution(), MSRouteHandler::openVehicleTypeDistribution(), RORouteHandler::openVehicleTypeDistribution(), SUMOVehicleParserHelper::parseCommonAttributes(), RONetHandler::parseDistrict(), RONetHandler::parseEdge(), SUMOVehicleParserHelper::parseFlowAttributes(), RORouteHandler::parseFromTo(), NIXMLConnectionsHandler::parseLaneInfo(), SUMOVehicleParserHelper::parseStop(), AGActivityGenHandler::parseStreets(), SUMOVehicleParserHelper::parseVehicleAttributes(), SUMOVehicleParserHelper::parseVTypeEmbedded(), NIImporter_SUMO::readPosition(), NIXMLEdgesHandler::setNodes(), NIXMLEdgesHandler::tryGetShape(), and SAXWeightsHandler::tryParse().
|
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, and SUMOSAXAttributesImpl_Xerces.
|
private |
Invalidated assignment operator.
|
static |
Splits the given string.
Spaces, ",", and ";" are assumed to be separator characters. Though, in the case a "," or a ";" occurs, a warning is generated (once).
[in] | def | The string to split |
[out] | into | The vector to fill |
Definition at line 170 of file SUMOSAXAttributes.cpp.
References StringTokenizer::hasNext(), myHaveInformedAboutDeprecatedDivider, StringTokenizer::next(), and WRITE_WARNING.
Referenced by NIXMLEdgesHandler::addSplit(), SUMOSAXAttributesImpl_Xerces::getStringVector(), SUMOSAXAttributesImpl_Binary::getStringVector(), NLTriggerBuilder::parseAndBuildBusStop(), NLTriggerBuilder::parseAndBuildLaneSpeedTrigger(), NLTriggerBuilder::parseAndBuildRerouter(), and NIXMLNodesHandler::processTrafficLightDefinitions().
|
pure virtual |
Prints all attribute names and values into the given stream.
[in] | os | The stream to use |
Implemented in SUMOSAXAttributesImpl_Binary, and SUMOSAXAttributesImpl_Xerces.
Referenced by operator<<().
|
friend |
Definition at line 425 of file SUMOSAXAttributes.h.
|
static |
The encoding of parsed strings.
Definition at line 388 of file SUMOSAXAttributes.h.
Referenced by OptionsCont::writeConfiguration(), OptionsCont::writeSchema(), and OptionsCont::writeXMLHeader().
|
staticprivate |
Information whether the usage of a deprecated divider was reported.
Definition at line 410 of file SUMOSAXAttributes.h.
Referenced by parseStringVector().
|
private |
the object type to use in error reporting
Definition at line 420 of file SUMOSAXAttributes.h.
Referenced by emitEmptyError(), emitFormatError(), emitUngivenError(), and getObjectType().