![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Encapsulated Xerces-SAX-attributes. More...
#include <SUMOSAXAttributesImpl_Xerces.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... | |
SUMOSAXAttributesImpl_Xerces (const XERCES_CPP_NAMESPACE::Attributes &attrs, const std::vector< XMLCh * > &predefinedTags, const std::vector< std::string > &predefinedTagsMML, const std::string &objectType) | |
Constructor. More... | |
virtual | ~SUMOSAXAttributesImpl_Xerces () |
Destructor. More... | |
methods for retrieving attribute values | |
typedef std::vector< XMLCh * > | AttrMap |
Definition of a map of attribute ids to their xerces-representation. More... | |
const XERCES_CPP_NAMESPACE::Attributes & | myAttrs |
The encapsulated attributes. More... | |
const AttrMap & | myPredefinedTags |
Map of attribute ids to their xerces-representation. More... | |
const std::vector< std::string > & | myPredefinedTagsMML |
Map of attribute ids to their (readable) string-representation. More... | |
bool | hasAttribute (int id) const |
Returns the information whether the named (by its enum-value) attribute is within the current list. More... | |
bool | getBool (int id) const |
Returns the bool-value of the named (by its enum-value) attribute. More... | |
int | getInt (int id) const |
Returns the int-value of the named (by its enum-value) attribute. More... | |
long long int | getLong (int id) const |
Returns the long-value of the named (by its enum-value) attribute. More... | |
std::string | getString (int id) const |
Returns the string-value of the named (by its enum-value) attribute. More... | |
std::string | getStringSecure (int id, const std::string &def) const |
Returns the string-value of the named (by its enum-value) attribute. More... | |
double | getFloat (int id) const |
Returns the double-value of the named (by its enum-value) attribute. More... | |
bool | hasAttribute (const std::string &id) const |
Returns the information whether the named attribute is within the current list. More... | |
double | getFloat (const std::string &id) const |
Returns the double-value of the named attribute. More... | |
std::string | getStringSecure (const std::string &id, const std::string &def) const |
Returns the string-value of the named (by its enum-value) attribute. More... | |
SumoXMLEdgeFunc | getEdgeFunc (bool &ok) const |
Returns the value of the named attribute. More... | |
SumoXMLNodeType | getNodeType (bool &ok) const |
Returns the value of the named attribute. More... | |
RightOfWay | getRightOfWay (bool &ok) const |
returns rightOfWay method More... | |
FringeType | getFringeType (bool &ok) const |
returns fringe type More... | |
RGBColor | getColor () const |
Returns the value of the named attribute. More... | |
PositionVector | getShape (int attr) const |
Tries to read given attribute assuming it is a PositionVector. More... | |
Boundary | getBoundary (int attr) const |
Tries to read given attribute assuming it is a Boundary. More... | |
std::string | getName (int attr) const |
Converts the given attribute id into a man readable string. More... | |
void | serialize (std::ostream &os) const |
Prints all attribute names and values into the given stream. More... | |
std::vector< std::string > | getAttributeNames () const |
Retrieves all attribute names. More... | |
SUMOSAXAttributes * | clone () const |
return a new deep-copy attributes object More... | |
const XMLCh * | getAttributeValueSecure (int id) const |
Returns Xerces-value of the named attribute. More... | |
SUMOSAXAttributesImpl_Xerces (const SUMOSAXAttributesImpl_Xerces &src) | |
Invalidated copy constructor. More... | |
SUMOSAXAttributesImpl_Xerces & | operator= (const SUMOSAXAttributesImpl_Xerces &src) |
Invalidated assignment operator. More... | |
virtual methods for retrieving attribute values | |
std::string | myObjectType |
the object type to use in error reporting 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... | |
const std::string & | getObjectType () const |
return the objecttype to which these attributes belong More... | |
static const std::string | ENCODING = " encoding=\"UTF-8\"" |
The encoding of parsed strings. 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 |
Encapsulated Xerces-SAX-attributes.
Definition at line 43 of file SUMOSAXAttributesImpl_Xerces.h.
|
private |
Definition of a map of attribute ids to their xerces-representation.
Definition at line 299 of file SUMOSAXAttributesImpl_Xerces.h.
SUMOSAXAttributesImpl_Xerces::SUMOSAXAttributesImpl_Xerces | ( | const XERCES_CPP_NAMESPACE::Attributes & | attrs, |
const std::vector< XMLCh * > & | predefinedTags, | ||
const std::vector< std::string > & | predefinedTagsMML, | ||
const std::string & | objectType | ||
) |
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 41 of file SUMOSAXAttributesImpl_Xerces.cpp.
|
virtual |
Destructor.
Definition at line 51 of file SUMOSAXAttributesImpl_Xerces.cpp.
|
private |
Invalidated copy constructor.
|
virtual |
return a new deep-copy attributes object
Implements SUMOSAXAttributes.
Definition at line 265 of file SUMOSAXAttributesImpl_Xerces.cpp.
References SUMOSAXAttributes::getObjectType(), myAttrs, myPredefinedTagsMML, and StringUtils::transcode().
|
protectedinherited |
Definition at line 160 of file SUMOSAXAttributes.cpp.
References SUMOSAXAttributes::myObjectType, and WRITE_ERROR.
Referenced by SUMOSAXAttributes::get(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::getOptSUMOTimeReporting(), and SUMOSAXAttributes::getSUMOTimeReporting().
|
protectedinherited |
Definition at line 174 of file SUMOSAXAttributes.cpp.
References SUMOSAXAttributes::myObjectType, and WRITE_ERROR.
Referenced by SUMOSAXAttributes::get(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::getOptSUMOTimeReporting(), and SUMOSAXAttributes::getSUMOTimeReporting().
|
protectedinherited |
Definition at line 146 of file SUMOSAXAttributes.cpp.
References SUMOSAXAttributes::myObjectType, and WRITE_ERROR.
Referenced by SUMOSAXAttributes::get(), and SUMOSAXAttributes::getSUMOTimeReporting().
|
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 490 of file SUMOSAXAttributes.h.
References SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::emitUngivenError(), SUMOSAXAttributes::getName(), and SUMOSAXAttributes::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(), ROJTRTurnDefLoader::addEdgeRel(), NLHandler::addInsertionPredecessorConstraint(), NLHandler::addInstantE1Detector(), NIXMLNodesHandler::addJoinCluster(), NIXMLNodesHandler::addJoinExclusion(), NIImporter_SUMO::addJunction(), NIImporter_SUMO::addLane(), NIXMLEdgesHandler::addLane(), NLHandler::addLane(), NIXMLNodesHandler::addNode(), NLHandler::addParam(), RONetHandler::addParam(), SUMORouteHandler::addParam(), GNERouteHandler::PersonValue::addPersonValue(), NLHandler::addPhase(), NIImporter_SUMO::addPhase(), ShapeHandler::addPOI(), ShapeHandler::addPoly(), NLHandler::addPredecessorConstraint(), NIXMLPTHandler::addPTLine(), NIXMLPTHandler::addPTLineFromFlow(), NIXMLPTHandler::addPTLineStop(), NIXMLPTHandler::addPTStop(), NIImporter_SUMO::addRequest(), NLHandler::addRequest(), MSRouteHandler::addRide(), NIXMLPTHandler::addRoute(), NLHandler::addRouteProbeDetector(), NIXMLPTHandler::addRouteStop(), NIXMLEdgesHandler::addSplit(), ROJTRTurnDefLoader::addToEdge(), MSRouteHandler::addTransport(), 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(), NLHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::loadLocation(), MSRailSignalConstraint_Predecessor::loadState(), RODFDetectorHandler::myStartElement(), ROJTRTurnDefLoader::myStartElement(), MSRouteHandler::myStartElement(), MSStateHandler::myStartElement(), NIImporter_MATSim::NodesHandler::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), NIImporter_OpenDrive::myStartElement(), NIImporter_SUMO::myStartElement(), NIXMLConnectionsHandler::myStartElement(), NIXMLEdgesHandler::myStartElement(), NIXMLNodesHandler::myStartElement(), NIXMLPTHandler::myStartElement(), NIXMLTrafficLightsHandler::myStartElement(), NIXMLTypesHandler::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Zuflussdefinition::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Parkplatzdefinition::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Fahrzeugklassendefinition::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_VWunschentscheidungsdefinition::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_Routenentscheidungsdefinition::myStartElement(), NIImporter_Vissim::NIVissimXMLHandler_ConflictArea::myStartElement(), NLHandler::myStartElement(), ODAmitranHandler::myStartElement(), PCLoaderOSM::NodesHandler::myStartElement(), PCLoaderOSM::RelationsHandler::myStartElement(), PCLoaderOSM::EdgesHandler::myStartElement(), PCLoaderXML::myStartElement(), PCNetProjectionLoader::myStartElement(), PCTypeDefHandler::myStartElement(), RONetHandler::myStartElement(), RORouteHandler::myStartElement(), TrajectoriesHandler::myStartElement(), GUISettingsHandler::myStartElement(), ShapeHandler::myStartElement(), NIImporter_OpenStreetMap::NodesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::RelationHandler::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(), NLTriggerBuilder::parseAndBuildOverheadWireClamp(), NLTriggerBuilder::parseAndBuildOverheadWireSection(), NLTriggerBuilder::parseAndBuildOverheadWireSegment(), GNEAdditionalHandler::parseAndBuildParkingSpace(), NLTriggerBuilder::parseAndBuildRerouter(), GNEAdditionalHandler::parseAndBuildRerouterClosingLaneReroute(), GNEAdditionalHandler::parseAndBuildRerouterClosingReroute(), GNEAdditionalHandler::parseAndBuildRerouterDestProbReroute(), GNEAdditionalHandler::parseAndBuildRerouterInterval(), GNEAdditionalHandler::parseAndBuildRerouterParkingAreaReroute(), GNEAdditionalHandler::parseAndBuildRerouterRouteProbReroute(), NLTriggerBuilder::parseAndBuildStoppingPlace(), GNEAdditionalHandler::parseAndBuildTAZ(), GNEAdditionalHandler::parseAndBuildTAZSink(), GNEAdditionalHandler::parseAndBuildTAZSource(), NLTriggerBuilder::parseAndBuildTractionSubstation(), GNEAdditionalHandler::parseAndBuildVariableSpeedSignStep(), GNEAttributeCarrier::parseAttributeFromXML(), SUMOVehicleParserHelper::parseCommonAttributes(), RONetHandler::parseConnection(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), RONetHandler::parseDistrict(), RONetHandler::parseDistrictEdge(), RONetHandler::parseEdge(), SUMOVehicleParserHelper::parseFlowAttributes(), MSRouteHandler::parseFromViaTo(), RORouteHandler::parseFromViaTo(), SUMOVehicleParserHelper::parseID(), SUMOVehicleParserHelper::parseJMParams(), RONetHandler::parseJunction(), RONetHandler::parseLane(), NIXMLConnectionsHandler::parseLaneBound(), NIXMLConnectionsHandler::parseLaneDefinition(), SUMOVehicleParserHelper::parseLCParams(), GNEAttributeCarrier::parseMaskedPositionAttribute(), GNEAdditionalHandler::parseParameter(), GNEDataHandler::parseParameter(), AGActivityGenHandler::parseStation(), SUMORouteHandler::parseStop(), parseStopOffsets(), RONetHandler::parseStoppingPlace(), ODDistrictHandler::parseTAZ(), SUMOVehicleParserHelper::parseVehicleAttributes(), SUMOVehicleParserHelper::parseVTypeEmbedded(), MSRouteHandler::parseWalkPositions(), RORouteHandler::parseWalkPositions(), NIXMLNodesHandler::processNodeType(), NIXMLNodesHandler::processTrafficLightDefinitions(), NIImporter_SUMO::readPosition(), NIXMLTrafficLightsHandler::removeTlConnection(), NIXMLTrafficLightsHandler::retrieveEdge(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NLHandler::setLocation(), RONetHandler::setLocation(), NIXMLEdgesHandler::setNodes(), and SAXWeightsHandler::tryParseEdgeRel().
|
virtual |
Retrieves all attribute names.
Implements SUMOSAXAttributes.
Definition at line 255 of file SUMOSAXAttributesImpl_Xerces.cpp.
References myAttrs, and StringUtils::transcode().
|
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 106 of file SUMOSAXAttributesImpl_Xerces.cpp.
References myAttrs, and myPredefinedTags.
Referenced by getString(), and getStringSecure().
|
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 64 of file SUMOSAXAttributesImpl_Xerces.cpp.
References getString(), and StringUtils::toBool().
|
virtual |
Tries to read given attribute assuming it is a Boundary.
[in] | attr | The id of the attribute to read |
Implements SUMOSAXAttributes.
Definition at line 223 of file SUMOSAXAttributesImpl_Xerces.cpp.
References getString(), StringTokenizer::next(), StringTokenizer::size(), and StringUtils::toDouble().
|
virtual |
Returns the value of the named attribute.
Tries to retrieve the attribute from the the attribute list.
Implements SUMOSAXAttributes.
Definition at line 195 of file SUMOSAXAttributesImpl_Xerces.cpp.
References getString(), RGBColor::parseColor(), and SUMO_ATTR_COLOR.
|
virtual |
Returns the value of the named attribute.
Tries to retrieve the attribute from the the attribute list.
Implements SUMOSAXAttributes.
Definition at line 146 of file SUMOSAXAttributesImpl_Xerces.cpp.
References SUMOXMLDefinitions::EdgeFunctions, StringBijection< T >::get(), getString(), hasAttribute(), NORMAL, and SUMO_ATTR_FUNCTION.
|
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 |
Implements SUMOSAXAttributes.
Definition at line 114 of file SUMOSAXAttributesImpl_Xerces.cpp.
References myAttrs, StringUtils::toDouble(), StringUtils::transcode(), and transcode().
|
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 |
Implements SUMOSAXAttributes.
Definition at line 100 of file SUMOSAXAttributesImpl_Xerces.cpp.
References getString(), and StringUtils::toDouble().
|
virtual |
returns fringe type
Implements SUMOSAXAttributes.
Definition at line 183 of file SUMOSAXAttributesImpl_Xerces.cpp.
References DEFAULT, SUMOXMLDefinitions::FringeTypeValues, StringBijection< T >::get(), getString(), hasAttribute(), and SUMO_ATTR_FRINGE.
|
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 70 of file SUMOSAXAttributesImpl_Xerces.cpp.
References getString(), and StringUtils::toInt().
|
inherited |
Definition at line 52 of file SUMOSAXAttributes.cpp.
References SUMOSAXAttributes::getString().
|
protectedinherited |
|
inherited |
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 127 of file SUMOSAXAttributes.cpp.
References SUMOSAXAttributes::getString(), StringTokenizer::getVector(), and StringUtils::toInt().
|
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 |
Implements SUMOSAXAttributes.
Definition at line 76 of file SUMOSAXAttributesImpl_Xerces.cpp.
References getString(), and StringUtils::toLong().
|
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 238 of file SUMOSAXAttributesImpl_Xerces.cpp.
References myPredefinedTagsMML.
|
virtual |
Returns the value of the named attribute.
Tries to retrieve the attribute from the the attribute list.
Implements SUMOSAXAttributes.
Definition at line 159 of file SUMOSAXAttributesImpl_Xerces.cpp.
References StringBijection< T >::get(), getString(), hasAttribute(), SUMOXMLDefinitions::NodeTypes, SUMO_ATTR_TYPE, and UNKNOWN.
|
inlineinherited |
return the objecttype to which these attributes belong
Definition at line 394 of file SUMOSAXAttributes.h.
References SUMOSAXAttributes::myObjectType.
Referenced by SUMOSAXAttributesImpl_Cached::clone(), clone(), SUMOVehicleParserHelper::parseGuiShape(), ODDistrictHandler::parseTAZ(), and SUMOVehicleParserHelper::parseVehicleClass().
|
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 516 of file SUMOSAXAttributes.h.
References SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::getName(), and SUMOSAXAttributes::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::addInsertionPredecessorConstraint(), NLHandler::addInstantE1Detector(), NIXMLNodesHandler::addJoinCluster(), NIImporter_SUMO::addJunction(), NIImporter_SUMO::addLane(), NIXMLEdgesHandler::addLane(), NLHandler::addLane(), NLHandler::addMesoEdgeType(), MSRouteHandler::addPersonTrip(), RORouteHandler::addPersonTrip(), NLHandler::addPhase(), NIImporter_SUMO::addPhase(), ShapeHandler::addPOI(), ShapeHandler::addPoly(), NLHandler::addPredecessorConstraint(), NIImporter_SUMO::addProhibition(), NIXMLPTHandler::addPTLine(), NIXMLPTHandler::addPTLineFromFlow(), NIXMLPTHandler::addPTStop(), NLHandler::addRequest(), MSRouteHandler::addRide(), NLHandler::addRouteProbeDetector(), NIXMLEdgesHandler::addSplit(), MSRouteHandler::addStop(), GNERouteHandler::addStop(), RORouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), MSRouteHandler::addTransport(), 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(), NLHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), RODFDetectorHandler::myStartElement(), MSRouteHandler::myStartElement(), MSStateHandler::myStartElement(), MSCalibrator::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), NIImporter_OpenDrive::myStartElement(), NIImporter_SUMO::myStartElement(), NIXMLConnectionsHandler::myStartElement(), NIXMLTypesHandler::myStartElement(), NLHandler::myStartElement(), PCLoaderOSM::NodesHandler::myStartElement(), PCLoaderOSM::RelationsHandler::myStartElement(), PCLoaderOSM::EdgesHandler::myStartElement(), PCLoaderXML::myStartElement(), PCTypeDefHandler::myStartElement(), RORouteHandler::myStartElement(), TrajectoriesHandler::myStartElement(), GUISettingsHandler::myStartElement(), SAXWeightsHandler::myStartElement(), NLHandler::openJunction(), MSRouteHandler::openRoute(), RORouteHandler::openRoute(), RORouteHandler::openRouteDistribution(), RONetHandler::parseAccess(), NLTriggerBuilder::parseAndAddLotEntry(), NLTriggerBuilder::parseAndBeginParkingArea(), NLTriggerBuilder::parseAndBuildCalibrator(), NLTriggerBuilder::parseAndBuildChargingStation(), NLTriggerBuilder::parseAndBuildOverheadWireSection(), NLTriggerBuilder::parseAndBuildOverheadWireSegment(), GNEAdditionalHandler::parseAndBuildPoly(), GNEAdditionalHandler::parseAndBuildRerouter(), NLTriggerBuilder::parseAndBuildRerouter(), NLTriggerBuilder::parseAndBuildStoppingPlace(), NLTriggerBuilder::parseAndBuildTractionSubstation(), 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(), RORouteHandler::parseWalkPositions(), NIXMLNodesHandler::processNodeType(), NIXMLNodesHandler::processTrafficLightDefinitions(), NIImporter_SUMO::readPosition(), NIXMLEdgesHandler::tryGetLaneSpread(), and NIXMLEdgesHandler::tryGetShape().
|
inherited |
convenience function to avoid the default argument and the template stuff at getOpt<>
Definition at line 141 of file SUMOSAXAttributes.cpp.
Referenced by NLHandler::addPhase(), and NIImporter_SUMO::addPhase().
|
inherited |
convenience function to avoid the default argument and the template stuff at getOpt<>
Definition at line 122 of file SUMOSAXAttributes.cpp.
Referenced by NIXMLEdgesHandler::addSplit(), NLTriggerBuilder::parseAndBeginParkingArea(), NLTriggerBuilder::parseAndBuildStoppingPlace(), SUMORouteHandler::parseStop(), and NIXMLNodesHandler::processTrafficLightDefinitions().
|
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 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 89 of file SUMOSAXAttributes.cpp.
References SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::getName(), SUMOSAXAttributes::hasAttribute(), and string2time().
Referenced by NLHandler::addE2Detector(), NLHandler::addEdgeLaneMeanData(), NLHandler::addMesoEdgeType(), MSRouteHandler::addPersonTrip(), RORouteHandler::addPersonTrip(), NLHandler::addPhase(), NIImporter_SUMO::addPhase(), MSRouteHandler::addRide(), NLHandler::addRouteProbeDetector(), MSRouteHandler::addWalk(), NLHandler::beginE3Detector(), NLHandler::initTrafficLightLogic(), MSCalibrator::myStartElement(), MSTriggeredRerouter::myStartElement(), GUISettingsHandler::myStartElement(), MSRouteHandler::openRoute(), RORouteHandler::openRoute(), NLHandler::openWAUT(), NLTriggerBuilder::parseAndBuildCalibrator(), GNEAdditionalHandler::parseAndBuildRerouter(), and SUMORouteHandler::parseStop().
|
virtual |
returns rightOfWay method
Implements SUMOSAXAttributes.
Definition at line 171 of file SUMOSAXAttributesImpl_Xerces.cpp.
References DEFAULT, StringBijection< T >::get(), getString(), hasAttribute(), SUMOXMLDefinitions::RightOfWayValues, and SUMO_ATTR_RIGHT_OF_WAY.
|
virtual |
Tries to read given attribute assuming it is a PositionVector.
[in] | attr | The id of the attribute to read |
Implements SUMOSAXAttributes.
Definition at line 201 of file SUMOSAXAttributesImpl_Xerces.cpp.
References getString(), StringTokenizer::hasNext(), StringTokenizer::next(), StringTokenizer::size(), and StringUtils::toDouble().
|
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 82 of file SUMOSAXAttributesImpl_Xerces.cpp.
References getAttributeValueSecure(), and StringUtils::transcode().
Referenced by getBool(), getBoundary(), getColor(), getEdgeFunc(), getFloat(), getFringeType(), getInt(), getLong(), getNodeType(), getRightOfWay(), getShape(), getStringSecure(), and GenericSAXHandler::startElement().
|
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 132 of file SUMOSAXAttributesImpl_Xerces.cpp.
References myAttrs, StringUtils::transcode(), and transcode().
|
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 88 of file SUMOSAXAttributesImpl_Xerces.cpp.
References getAttributeValueSecure(), and getString().
|
inherited |
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 112 of file SUMOSAXAttributes.cpp.
References SUMOSAXAttributes::getString(), and StringTokenizer::getVector().
Referenced by NLHandler::addDistrict(), NIXMLPTHandler::addPTLineRoute(), NIImporter_SUMO::addRoundabout(), NIXMLEdgesHandler::addRoundabout(), NLHandler::addRoundabout(), NIXMLPTHandler::addRoute(), MSRailSignalConstraint_Predecessor::loadState(), MSStateHandler::myStartElement(), ODDistrictHandler::openDistrict(), NLTriggerBuilder::parseAndBuildOverheadWireSection(), RONetHandler::parseDistrict(), MSRouteHandler::parseFromViaTo(), and RORouteHandler::parseFromViaTo().
|
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 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 62 of file SUMOSAXAttributes.cpp.
References SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::emitUngivenError(), SUMOSAXAttributes::getName(), SUMOSAXAttributes::hasAttribute(), and string2time().
Referenced by NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addPhase(), NLHandler::addRouteProbeDetector(), NLHandler::addVTypeProbeDetector(), NLHandler::addWAUTSwitch(), NLHandler::beginE3Detector(), SUMOVehicleParserHelper::beginVTypeParsing(), NLTriggerBuilder::buildVaporizer(), GUINet::DiscoverAttributes::myStartElement(), MSCalibrator::myStartElement(), MSLaneSpeedTrigger::myStartElement(), TrajectoriesHandler::myStartElement(), GUISettingsHandler::myStartElement(), SUMORouteHandler::myStartElement(), SAXWeightsHandler::myStartElement(), and SUMOVehicleParserHelper::parseFlowAttributes().
|
virtual |
Returns the information whether the named attribute is within the current list.
Implements SUMOSAXAttributes.
Definition at line 123 of file SUMOSAXAttributesImpl_Xerces.cpp.
References myAttrs, and transcode().
|
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 56 of file SUMOSAXAttributesImpl_Xerces.cpp.
References myAttrs, and myPredefinedTags.
Referenced by getEdgeFunc(), getFringeType(), getNodeType(), and getRightOfWay().
|
private |
Invalidated assignment operator.
|
virtual |
Prints all attribute names and values into the given stream.
[in] | os | The stream to use |
Implements SUMOSAXAttributes.
Definition at line 246 of file SUMOSAXAttributesImpl_Xerces.cpp.
References myAttrs, and StringUtils::transcode().
|
staticinherited |
The encoding of parsed strings.
Definition at line 405 of file SUMOSAXAttributes.h.
Referenced by OptionsCont::writeXMLHeader().
|
private |
The encapsulated attributes.
Definition at line 296 of file SUMOSAXAttributesImpl_Xerces.h.
Referenced by clone(), getAttributeNames(), getAttributeValueSecure(), getFloat(), getStringSecure(), hasAttribute(), and serialize().
|
privateinherited |
the object type to use in error reporting
Definition at line 422 of file SUMOSAXAttributes.h.
Referenced by SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::emitUngivenError(), and SUMOSAXAttributes::getObjectType().
|
private |
Map of attribute ids to their xerces-representation.
Definition at line 301 of file SUMOSAXAttributesImpl_Xerces.h.
Referenced by getAttributeValueSecure(), and hasAttribute().
|
private |
Map of attribute ids to their (readable) string-representation.
Definition at line 304 of file SUMOSAXAttributesImpl_Xerces.h.