|
SUMO - Simulation of Urban MObility
|
Encapsulated Xerces-SAX-attributes. More...
#include <SUMOSAXAttributesImpl_Xerces.h>
Public Member Functions | |
| bool | getBoolReporting (int attr, const char *objectid, bool &ok, bool report=true) const throw () |
| Tries to read given attribute assuming it is a boolean. | |
| int | getIntReporting (int attr, const char *objectid, bool &ok, bool report=true) const throw () |
| Tries to read given attribute assuming it is an int. | |
| bool | getOptBoolReporting (int attr, const char *objectid, bool &ok, bool defaultValue, bool report=true) const throw () |
| Tries to read given attribute assuming it is a boolean. | |
| int | getOptIntReporting (int attr, const char *objectid, bool &ok, int defaultValue, bool report=true) const throw () |
| Tries to read given attribute assuming it is an int. | |
| std::string | getOptStringReporting (int attr, const char *objectid, bool &ok, const std::string &defaultValue, bool report=true) const throw () |
| Tries to read given attribute assuming it is a string. | |
| SUMOReal | getOptSUMORealReporting (int attr, const char *objectid, bool &ok, SUMOReal defaultValue, bool report=true) const throw () |
| Tries to read given attribute assuming it is a SUMOReal. | |
| SUMOTime | getOptSUMOTimeReporting (int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const throw () |
| Tries to read given attribute assuming it is a SUMOTime. | |
| std::string | getStringReporting (int attr, const char *objectid, bool &ok, bool report=true) const throw () |
| Tries to read given attribute assuming it is a string. | |
| SUMOReal | getSUMORealReporting (int attr, const char *objectid, bool &ok, bool report=true) const throw () |
| Tries to read given attribute assuming it is a SUMOReal. | |
| SUMOTime | getSUMOTimeReporting (int attr, const char *objectid, bool &ok, bool report=true) const throw () |
| Tries to read given attribute assuming it is a SUMOTime. | |
| SUMOSAXAttributesImpl_Xerces (const Attributes &attrs, const std::map< int, XMLCh * > &predefinedTags, const std::map< int, std::string > &predefinedTagsMML, const std::string &objectType) throw () | |
| Constructor. | |
| virtual | ~SUMOSAXAttributesImpl_Xerces () throw () |
| Destructor. | |
virtual methods for retrieving attribute values | |
| const std::string & | getObjectType () const |
| return the objecttype to which these attributes belong | |
| static void | parseStringVector (const std::string &def, std::vector< std::string > &into) throw () |
| Splits the given string. | |
| void | emitUngivenError (const std::string &attrname, const char *objectid) const throw () |
| void | emitEmptyError (const std::string &attrname, const char *objectid) const throw () |
| void | emitFormatError (const std::string &attrname, const std::string &type, const char *objectid) const throw () |
methods for retrieving attribute values | |
| typedef std::map< int, XMLCh * > | AttrMap |
| Definition of a map of attribute ids to their xerces-representation. | |
| const Attributes & | myAttrs |
| The encapsulated attributes. | |
| const AttrMap & | myPredefinedTags |
| Map of attribute ids to their xerces-representation. | |
| const std::map< int, std::string > & | myPredefinedTagsMML |
| Map of attribute ids to their (readable) string-representation. | |
| bool | hasAttribute (int id) const throw () |
| Returns the information whether the named (by its enum-value) attribute is within the current list. | |
| bool | getBool (int id) const throw (EmptyData, BoolFormatException) |
| Returns the bool-value of the named (by its enum-value) attribute. | |
| bool | getBoolSecure (int id, bool def) const throw (EmptyData) |
| Returns the bool-value of the named (by its enum-value) attribute or the given value if the attribute is not known. | |
| int | getInt (int id) const throw (EmptyData, NumberFormatException) |
| Returns the int-value of the named (by its enum-value) attribute. | |
| int | getIntSecure (int id, int def) const throw (EmptyData, NumberFormatException) |
| Returns the int-value of the named (by its enum-value) attribute. | |
| std::string | getString (int id) const throw (EmptyData) |
| Returns the string-value of the named (by its enum-value) attribute. | |
| std::string | getStringSecure (int id, const std::string &def) const throw (EmptyData) |
| Returns the string-value of the named (by its enum-value) attribute. | |
| SUMOReal | getFloat (int id) const throw (EmptyData, NumberFormatException) |
| Returns the SUMOReal-value of the named (by its enum-value) attribute. | |
| SUMOReal | getFloatSecure (int id, SUMOReal def) const throw (EmptyData, NumberFormatException) |
| Returns the SUMOReal-value of the named (by its enum-value) attribute. | |
| bool | hasAttribute (const std::string &id) const throw () |
| Returns the information whether the named attribute is within the current list. | |
| SUMOReal | getFloat (const std::string &id) const throw (EmptyData, NumberFormatException) |
| Returns the SUMOReal-value of the named attribute. | |
| std::string | getStringSecure (const std::string &id, const std::string &def) const throw () |
| Returns the string-value of the named (by its enum-value) attribute. | |
| std::string | getName (int attr) const throw () |
| Converts the given attribute id into a man readable string. | |
| const XMLCh * | getAttributeValueSecure (int id) const throw () |
| Returns Xerces-value of the named attribute. | |
| SUMOSAXAttributesImpl_Xerces (const SUMOSAXAttributesImpl_Xerces &src) | |
| Invalidated copy constructor. | |
| SUMOSAXAttributesImpl_Xerces & | operator= (const SUMOSAXAttributesImpl_Xerces &src) |
| Invalidated assignment operator. | |
Encapsulated Xerces-SAX-attributes.
Definition at line 56 of file SUMOSAXAttributesImpl_Xerces.h.
typedef std::map<int, XMLCh*> SUMOSAXAttributesImpl_Xerces::AttrMap [private] |
Definition of a map of attribute ids to their xerces-representation.
Definition at line 288 of file SUMOSAXAttributesImpl_Xerces.h.
| SUMOSAXAttributesImpl_Xerces::SUMOSAXAttributesImpl_Xerces | ( | const Attributes & | attrs, |
| const std::map< int, XMLCh * > & | predefinedTags, | ||
| const std::map< int, std::string > & | predefinedTagsMML, | ||
| const std::string & | objectType | ||
| ) | throw () |
Constructor.
| [in] | attrs | The encapsulated xerces-attributes |
| [in] | predefinedTags | Map of attribute ids to their xerces-representation |
| [in] | predefinedTagsMML | Map of attribute ids to their (readable) string-representation |
Definition at line 45 of file SUMOSAXAttributesImpl_Xerces.cpp.
| SUMOSAXAttributesImpl_Xerces::~SUMOSAXAttributesImpl_Xerces | ( | ) | throw () [virtual] |
Destructor.
Definition at line 56 of file SUMOSAXAttributesImpl_Xerces.cpp.
| SUMOSAXAttributesImpl_Xerces::SUMOSAXAttributesImpl_Xerces | ( | const SUMOSAXAttributesImpl_Xerces & | src | ) | [private] |
Invalidated copy constructor.
| void SUMOSAXAttributes::emitEmptyError | ( | const std::string & | attrname, |
| const char * | objectid | ||
| ) | const throw () [protected, inherited] |
Definition at line 319 of file SUMOSAXAttributes.cpp.
References WRITE_ERROR.
| void SUMOSAXAttributes::emitFormatError | ( | const std::string & | attrname, |
| const std::string & | type, | ||
| const char * | objectid | ||
| ) | const throw () [protected, inherited] |
Definition at line 335 of file SUMOSAXAttributes.cpp.
References WRITE_ERROR.
| void SUMOSAXAttributes::emitUngivenError | ( | const std::string & | attrname, |
| const char * | objectid | ||
| ) | const throw () [protected, inherited] |
Definition at line 303 of file SUMOSAXAttributes.cpp.
References WRITE_ERROR.
| const XMLCh * SUMOSAXAttributesImpl_Xerces::getAttributeValueSecure | ( | int | id | ) | const throw () [private] |
Returns Xerces-value of the named attribute.
It is assumed that this attribute is within the stored attributes.
| [in] | id | The id of the attribute to retrieve the vale of |
Definition at line 122 of file SUMOSAXAttributesImpl_Xerces.cpp.
| bool SUMOSAXAttributesImpl_Xerces::getBool | ( | int | id | ) | const throw (EmptyData, BoolFormatException) [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 |
Implements SUMOSAXAttributes.
Definition at line 71 of file SUMOSAXAttributesImpl_Xerces.cpp.
References TplConvert< E >::_2bool().
| bool SUMOSAXAttributes::getBoolReporting | ( | int | attr, |
| const char * | objectid, | ||
| bool & | ok, | ||
| bool | report = true |
||
| ) | const throw () [inherited] |
Tries to read given attribute assuming it is a boolean.
If an error occurs (the attribute is not there, it is not a boolean), "ok" is set to false and an error message is written to MsgHandler::getErrorInstance.
Otherwise, "ok" is not changed.
| [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 152 of file SUMOSAXAttributes.cpp.
| bool SUMOSAXAttributesImpl_Xerces::getBoolSecure | ( | int | id, |
| bool | def | ||
| ) | const throw (EmptyData) [virtual] |
Returns the bool-value of the named (by its enum-value) attribute or the given value if the attribute is not known.
Tries to retrieve the attribute from the the attribute list. The retrieved attribute (which may be 0) is then parsed using TplConvert<XMLCh>::_2boolSec. If the attribute is empty, TplConvert<XMLCh>::_2boolSec throws an EmptyData-exception which is passed. If the attribute==0, TplConvert<XMLCh>::_2boolSec 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 value is an empty string |
Implements SUMOSAXAttributes.
Definition at line 77 of file SUMOSAXAttributesImpl_Xerces.cpp.
References TplConvertSec< E >::_2boolSec().
| SUMOReal SUMOSAXAttributesImpl_Xerces::getFloat | ( | int | id | ) | const throw (EmptyData, NumberFormatException) [virtual] |
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 |
Implements SUMOSAXAttributes.
Definition at line 109 of file SUMOSAXAttributesImpl_Xerces.cpp.
References TplConvert< E >::_2SUMOReal().
| SUMOReal SUMOSAXAttributesImpl_Xerces::getFloat | ( | const std::string & | id | ) | const throw (EmptyData, NumberFormatException) [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 |
Implements SUMOSAXAttributes.
Definition at line 130 of file SUMOSAXAttributesImpl_Xerces.cpp.
References TplConvert< E >::_2SUMOReal(), and SUMOReal.
| SUMOReal SUMOSAXAttributesImpl_Xerces::getFloatSecure | ( | int | id, |
| SUMOReal | def | ||
| ) | const throw (EmptyData, NumberFormatException) [virtual] |
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>::_2SUMORealSec. If the attribute is empty, TplConvert<XMLCh>::_2SUMORealSec throws an EmptyData-exception which is passed. If the attribute==0, TplConvert<XMLCh>::_2SUMORealSec returns the default value. If the value can not be parsed to a SUMOReal, TplConvert<XMLCh>::_2SUMORealSec throws a NumberFormatException-exception which is passed.
| [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 |
| NumberFormatException | If the attribute value can not be parsed to an SUMOReal |
Implements SUMOSAXAttributes.
Definition at line 115 of file SUMOSAXAttributesImpl_Xerces.cpp.
References TplConvertSec< E >::_2SUMORealSec().
| int SUMOSAXAttributesImpl_Xerces::getInt | ( | int | id | ) | const throw (EmptyData, NumberFormatException) [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 |
Implements SUMOSAXAttributes.
Definition at line 83 of file SUMOSAXAttributesImpl_Xerces.cpp.
References TplConvert< E >::_2int().
| int SUMOSAXAttributes::getIntReporting | ( | int | attr, |
| const char * | objectid, | ||
| bool & | ok, | ||
| bool | report = true |
||
| ) | const throw () [inherited] |
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 56 of file SUMOSAXAttributes.cpp.
Referenced by NLHandler::addConnection(), NIImporter_SUMO::addConnection(), NIXMLEdgesHandler::addEdge(), NIXMLEdgesHandler::addLane(), NLHandler::addLogicItem(), NLHandler::addRequest(), NLHandler::addSuccLane(), NIImporter_SUMO::addSuccLane(), NIXMLConnectionsHandler::parseLaneDefinition(), AGActivityGenHandler::parseStation(), NIXMLTrafficLightsHandler::removeTlConnection(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), and RORDLoader_SUMOBase::startAlternative().
| int SUMOSAXAttributesImpl_Xerces::getIntSecure | ( | int | id, |
| int | def | ||
| ) | const throw (EmptyData, NumberFormatException) [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>::_2intSec. If the attribute is empty, TplConvert<XMLCh>::_2intSec throws an EmptyData-exception which is passed. If the attribute==0, TplConvert<XMLCh>::_2intSec returns the default value. If the value can not be parsed to an int, TplConvert<XMLCh>::_2intSec throws a NumberFormatException-exception which is passed.
| [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 value is an empty string |
| NumberFormatException | If the attribute value can not be parsed to an int |
Implements SUMOSAXAttributes.
Definition at line 89 of file SUMOSAXAttributesImpl_Xerces.cpp.
References TplConvertSec< E >::_2intSec().
| std::string SUMOSAXAttributesImpl_Xerces::getName | ( | int | attr | ) | const throw () [virtual] |
Converts the given attribute id into a man readable string.
Returns a "?" if the attribute is not known.
| [in] | attr | The id of the attribute to return the name of |
Implements SUMOSAXAttributes.
Definition at line 158 of file SUMOSAXAttributesImpl_Xerces.cpp.
| const std::string& SUMOSAXAttributes::getObjectType | ( | ) | const [inline, inherited] |
return the objecttype to which these attributes belong
Definition at line 472 of file SUMOSAXAttributes.h.
References SUMOSAXAttributes::myObjectType.
Referenced by NIImporter_SUMO::addEdge(), NIImporter_SUMO::addJunction(), NIImporter_SUMO::addLane(), NLHandler::addPOI(), NLHandler::addPoly(), NLHandler::openJunction(), MSRouteHandler::openRoute(), SUMOVehicleParserHelper::parseEmissionClass(), SUMOVehicleParserHelper::parseGuiShape(), SUMOVehicleParserHelper::parseVehicleClass(), NLHandler::setLocation(), NIImporter_SUMO::setLocation(), and RORDLoader_SUMOBase::startRoute().
| bool SUMOSAXAttributes::getOptBoolReporting | ( | int | attr, |
| const char * | objectid, | ||
| bool & | ok, | ||
| bool | defaultValue, | ||
| bool | report = true |
||
| ) | const throw () [inherited] |
Tries to read given attribute assuming it is a boolean.
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 a boolean), "ok" is set to false. If report is true an error message is written to MsgHandler::getErrorInstance.
Otherwise, "ok" is not changed.
| [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 178 of file SUMOSAXAttributes.cpp.
Referenced by NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addE3Entry(), NLHandler::addE3Exit(), NIXMLEdgesHandler::addEdge(), NLHandler::addEdgeLaneMeanData(), NLHandler::addInstantE1Detector(), NLHandler::addLogicItem(), NLHandler::addPoly(), NLHandler::addRequest(), and NLHandler::addWAUTJunction().
| int SUMOSAXAttributes::getOptIntReporting | ( | int | attr, |
| const char * | objectid, | ||
| bool & | ok, | ||
| int | defaultValue, | ||
| bool | report = true |
||
| ) | const throw () [inherited] |
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 82 of file SUMOSAXAttributes.cpp.
Referenced by NIImporter_SUMO::addEdge(), NLHandler::addLane(), NLHandler::addPOI(), NLHandler::addPoly(), and NIXMLTrafficLightsHandler::addTlConnection().
| std::string SUMOSAXAttributes::getOptStringReporting | ( | int | attr, |
| const char * | objectid, | ||
| bool & | ok, | ||
| const std::string & | defaultValue, | ||
| bool | report = true |
||
| ) | const throw () [inherited] |
Tries to read given attribute assuming it is a string.
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), "ok" is set to false. If report is true an error message is written to MsgHandler::getErrorInstance.
Otherwise, "ok" is not changed.
| [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 226 of file SUMOSAXAttributes.cpp.
Referenced by NLDiscreteEventBuilder::addAction(), NLHandler::addConnection(), NIImporter_SUMO::addConnection(), NLHandler::addE2Detector(), NIXMLEdgesHandler::addEdge(), NIImporter_SUMO::addEdge(), NLHandler::addEdgeLaneMeanData(), NLHandler::addLane(), NIXMLEdgesHandler::addLane(), NIImporter_SUMO::addLane(), NIXMLNodesHandler::addNode(), NLHandler::addPOI(), NLHandler::addPoly(), NIImporter_SUMO::addProhibition(), NIXMLEdgesHandler::addSplit(), NLHandler::addSuccLane(), NIImporter_SUMO::addSuccLane(), NIXMLTrafficLightsHandler::addTlConnection(), NLHandler::addWAUTJunction(), NLHandler::beginEdgeParsing(), NLDiscreteEventBuilder::buildSaveTLStateCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchesCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchStatesCommand(), RORDLoader_TripDefs::getVehicleID(), NLHandler::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NLHandler::openJunction(), MSRouteHandler::openRoute(), SUMOVehicleParserHelper::parseEmissionClass(), SUMOVehicleParserHelper::parseGuiShape(), RONetHandler::parseLane(), SUMOVehicleParserHelper::parseVehicleClass(), NIXMLNodesHandler::processTrafficLightDefinitions(), and NIXMLEdgesHandler::tryGetLaneSpread().
| SUMOReal SUMOSAXAttributes::getOptSUMORealReporting | ( | int | attr, |
| const char * | objectid, | ||
| bool & | ok, | ||
| SUMOReal | defaultValue, | ||
| bool | report = true |
||
| ) | const throw () [inherited] |
Tries to read given attribute assuming it is a SUMOReal.
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] | 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 130 of file SUMOSAXAttributes.cpp.
References SUMOReal.
Referenced by NLHandler::addConnection(), NLHandler::addE2Detector(), NLHandler::addEdgeLaneMeanData(), NLHandler::addLane(), NIImporter_SUMO::addLane(), NLHandler::addPOI(), NLHandler::addSuccLane(), NLHandler::beginE3Detector(), MSLaneSpeedTrigger::myStartElement(), MSRouteHandler::openRoute(), and NIXMLEdgesHandler::tryGetPosition().
| SUMOTime SUMOSAXAttributes::getOptSUMOTimeReporting | ( | int | attr, |
| const char * | objectid, | ||
| bool & | ok, | ||
| SUMOTime | defaultValue, | ||
| bool | report = true |
||
| ) | const throw () [inherited] |
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 getIntReporting or getSUMORealReporting 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 274 of file SUMOSAXAttributes.cpp.
Referenced by NLHandler::addE2Detector(), NLHandler::addEdgeLaneMeanData(), NLHandler::addPhase(), NLHandler::addRouteProbeDetector(), NLHandler::beginE3Detector(), NLHandler::initTrafficLightLogic(), NLHandler::openWAUT(), and RORDGenerator_ODAmounts::parseInterval().
| std::string SUMOSAXAttributesImpl_Xerces::getString | ( | int | id | ) | const throw (EmptyData) [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 |
Implements SUMOSAXAttributes.
Definition at line 96 of file SUMOSAXAttributesImpl_Xerces.cpp.
References TplConvert< E >::_2str().
Referenced by GenericSAXHandler::startElement().
| std::string SUMOSAXAttributes::getStringReporting | ( | int | attr, |
| const char * | objectid, | ||
| bool & | ok, | ||
| bool | report = true |
||
| ) | const throw () [inherited] |
Tries to read given attribute assuming it is a string.
If an error occurs (the attribute is not there, it's empty), "ok" is set to false and an error message is written to MsgHandler::getErrorInstance.
Otherwise, "ok" is not changed.
| [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 200 of file SUMOSAXAttributes.cpp.
Referenced by NLHandler::addConnection(), NIImporter_SUMO::addConnection(), NLHandler::addDistrict(), NLHandler::addDistrictEdge(), NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addE3Entry(), NLHandler::addE3Exit(), NIXMLEdgesHandler::addEdge(), NIImporter_SUMO::addEdge(), NLHandler::addEdgeLaneMeanData(), NLHandler::addInstantE1Detector(), NIXMLNodesHandler::addJoinCluster(), NIXMLNodesHandler::addJoinExclusion(), NIImporter_SUMO::addJunction(), NLHandler::addLane(), NIImporter_SUMO::addLane(), NLHandler::addLogicItem(), NIXMLNodesHandler::addNode(), NLHandler::addParam(), NLHandler::addPhase(), NIImporter_SUMO::addPhase(), NLHandler::addPOI(), NLHandler::addPoly(), NLHandler::addRequest(), NLHandler::addRouteProbeDetector(), NIImporter_SUMO::addSuccEdge(), NLHandler::addSuccLane(), NIImporter_SUMO::addSuccLane(), NLHandler::addVTypeProbeDetector(), NLHandler::addWAUTJunction(), NLHandler::addWAUTSwitch(), NLHandler::beginE3Detector(), NLHandler::beginEdgeParsing(), NIXMLEdgesHandler::deleteEdge(), NIXMLNodesHandler::deleteNode(), RORDLoader_TripDefs::getEdge(), NLHandler::initJunctionLogic(), NLHandler::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NLHandler::openJunction(), MSRouteHandler::openRoute(), MSRouteHandler::openRouteDistribution(), NLHandler::openSucc(), MSRouteHandler::openVehicleTypeDistribution(), NLHandler::openWAUT(), RONetHandler::parseConnectedEdge(), RONetHandler::parseConnection(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), RONetHandler::parseDistrictEdge(), RONetHandler::parseEdge(), RONetHandler::parseJunction(), RONetHandler::parseLane(), NIXMLNodesHandler::processTrafficLightDefinitions(), NIXMLTrafficLightsHandler::removeTlConnection(), NIXMLTrafficLightsHandler::retrieveEdge(), NLHandler::setLocation(), NIImporter_SUMO::setLocation(), RORDLoader_SUMOBase::startAlternative(), RORDLoader_SUMOBase::startRoute(), and NIXMLEdgesHandler::tryGetLaneSpread().
| std::string SUMOSAXAttributesImpl_Xerces::getStringSecure | ( | int | id, |
| const std::string & | def | ||
| ) | const throw (EmptyData) [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 |
Implements SUMOSAXAttributes.
Definition at line 102 of file SUMOSAXAttributesImpl_Xerces.cpp.
References TplConvertSec< E >::_2strSec().
| std::string SUMOSAXAttributesImpl_Xerces::getStringSecure | ( | const std::string & | id, |
| const std::string & | def | ||
| ) | const throw () [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 |
Implements SUMOSAXAttributes.
Definition at line 148 of file SUMOSAXAttributesImpl_Xerces.cpp.
References TplConvertSec< E >::_2strSec().
| SUMOReal SUMOSAXAttributes::getSUMORealReporting | ( | int | attr, |
| const char * | objectid, | ||
| bool & | ok, | ||
| bool | report = true |
||
| ) | const throw () [inherited] |
Tries to read given attribute assuming it is a SUMOReal.
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] | 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 104 of file SUMOSAXAttributes.cpp.
References SUMOReal.
Referenced by NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addE3Entry(), NLHandler::addE3Exit(), NIXMLEdgesHandler::addEdge(), NLHandler::addInstantE1Detector(), NLHandler::addLane(), NIXMLEdgesHandler::addLane(), NIImporter_SUMO::addLane(), NIXMLNodesHandler::addNode(), NIImporter_SUMO::addPhase(), NIXMLEdgesHandler::addSplit(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NLHandler::openJunction(), RONetHandler::parseJunction(), RONetHandler::parseLane(), NIImporter_SUMO::readPosition(), and RORDLoader_SUMOBase::startRoute().
| SUMOTime SUMOSAXAttributes::getSUMOTimeReporting | ( | int | attr, |
| const char * | objectid, | ||
| bool & | ok, | ||
| bool | report = true |
||
| ) | const throw () [inherited] |
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 getIntReporting or getSUMORealReporting 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 244 of file SUMOSAXAttributes.cpp.
Referenced by NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addPhase(), NLHandler::addRouteProbeDetector(), NLHandler::addVTypeProbeDetector(), NLHandler::addWAUTSwitch(), NLHandler::beginE3Detector(), and MSLaneSpeedTrigger::myStartElement().
| bool SUMOSAXAttributesImpl_Xerces::hasAttribute | ( | int | id | ) | const throw () [virtual] |
Returns the information whether the named (by its enum-value) attribute is within the current list.
| [in] | id | The id of the searched attribute |
Implements SUMOSAXAttributes.
Definition at line 61 of file SUMOSAXAttributesImpl_Xerces.cpp.
| bool SUMOSAXAttributesImpl_Xerces::hasAttribute | ( | const std::string & | id | ) | const throw () [virtual] |
Returns the information whether the named attribute is within the current list.
Implements SUMOSAXAttributes.
Definition at line 139 of file SUMOSAXAttributesImpl_Xerces.cpp.
| SUMOSAXAttributesImpl_Xerces& SUMOSAXAttributesImpl_Xerces::operator= | ( | const SUMOSAXAttributesImpl_Xerces & | src | ) | [private] |
Invalidated assignment operator.
| void SUMOSAXAttributes::parseStringVector | ( | const std::string & | def, |
| std::vector< std::string > & | into | ||
| ) | throw () [static, inherited] |
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 351 of file SUMOSAXAttributes.cpp.
References StringTokenizer::hasNext(), StringTokenizer::next(), and WRITE_WARNING.
Referenced by NIXMLEdgesHandler::addLane(), NIXMLEdgesHandler::addSplit(), NLTriggerBuilder::parseAndBuildBusStop(), NLTriggerBuilder::parseAndBuildLaneSpeedTrigger(), NLTriggerBuilder::parseAndBuildRerouter(), and NIXMLNodesHandler::processTrafficLightDefinitions().
const Attributes& SUMOSAXAttributesImpl_Xerces::myAttrs [private] |
The encapsulated attributes.
Definition at line 285 of file SUMOSAXAttributesImpl_Xerces.h.
const AttrMap& SUMOSAXAttributesImpl_Xerces::myPredefinedTags [private] |
Map of attribute ids to their xerces-representation.
Definition at line 290 of file SUMOSAXAttributesImpl_Xerces.h.
const std::map<int, std::string>& SUMOSAXAttributesImpl_Xerces::myPredefinedTagsMML [private] |
Map of attribute ids to their (readable) string-representation.
Definition at line 293 of file SUMOSAXAttributesImpl_Xerces.h.