Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
SUMOSAXAttributesImpl_Xerces Class Reference

Encapsulated Xerces-SAX-attributes. More...

#include <SUMOSAXAttributesImpl_Xerces.h>

Inheritance diagram for SUMOSAXAttributesImpl_Xerces:
[legend]
Collaboration diagram for SUMOSAXAttributesImpl_Xerces:
[legend]

Public Member Functions

template<>
std::string fromString (const std::string &value) const
 
template<>
int fromString (const std::string &value) const
 
template<>
long long int fromString (const std::string &value) const
 
template<>
double fromString (const std::string &value) const
 
template<>
bool fromString (const std::string &value) const
 
template<>
RGBColor fromString (const std::string &value) const
 
template<>
Position fromString (const std::string &value) const
 
template<>
PositionVector fromString (const std::string &value) const
 
template<>
Boundary fromString (const std::string &value) const
 
template<>
SumoXMLEdgeFunc fromString (const std::string &value) const
 
template<>
SumoXMLNodeType fromString (const std::string &value) const
 
template<>
RightOfWay fromString (const std::string &value) const
 
template<>
FringeType fromString (const std::string &value) const
 
template<>
ParkingType fromString (const std::string &value) const
 
template<>
std::vector< std::string > fromString (const std::string &value) const
 
template<>
std::vector< int > fromString (const std::string &value) const
 
template<>
std::vector< double > fromString (const std::string &value) const
 
template<typename T >
get (int attr, const char *objectid, bool &ok, bool report=true) const
 Tries to read given attribute assuming it is an int.
 
template<typename T >
getOpt (int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
 Tries to read given attribute assuming it is an int.
 
SUMOTime getOptPeriod (const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
 Tries to read the SUMOTime 'period' attribute.
 
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.
 
SUMOTime getPeriod (const char *objectid, bool &ok, bool report=true) const
 Tries to read the SUMOTime 'period' attribute.
 
SUMOTime getSUMOTimeReporting (int attr, const char *objectid, bool &ok, bool report=true) const
 Tries to read given attribute assuming it is a SUMOTime.
 
 SUMOSAXAttributesImpl_Xerces (const XERCES_CPP_NAMESPACE::Attributes &attrs, const std::vector< XMLCh * > &predefinedTags, const std::vector< std::string > &predefinedTagsMML, const std::string &objectType)
 Constructor.
 
virtual ~SUMOSAXAttributesImpl_Xerces ()
 Destructor.
 

methods for retrieving attribute values

typedef std::vector< XMLCh * > AttrMap
 Definition of a map of attribute ids to their xerces-representation.
 
const XERCES_CPP_NAMESPACE::Attributes & myAttrs
 The encapsulated attributes.
 
const AttrMapmyPredefinedTags
 Map of attribute ids to their xerces-representation.
 
const std::vector< std::string > & myPredefinedTagsMML
 Map of attribute ids to their (readable) string-representation.
 
bool hasAttribute (int id) const
 Returns the information whether the named (by its enum-value) attribute is within the current list.
 
std::string getString (int id, bool *isPresent=nullptr) const
 Returns the string-value of the named (by its enum-value) attribute.
 
std::string getStringSecure (int id, const std::string &def) const
 Returns the string-value of the named (by its enum-value) attribute.
 
bool hasAttribute (const std::string &id) const
 Returns the information whether the named attribute is within the current list.
 
double getFloat (const std::string &id) const
 Returns the double-value of the named attribute.
 
std::string getStringSecure (const std::string &id, const std::string &def) const
 Returns the string-value of the named (by its enum-value) attribute.
 
std::string getName (int attr) const
 Converts the given attribute id into a man readable string.
 
void serialize (std::ostream &os) const
 Prints all attribute names and values into the given stream.
 
std::vector< std::string > getAttributeNames () const
 Retrieves all attribute names.
 
SUMOSAXAttributesclone () const
 return a new deep-copy attributes object
 
const XMLCh * getAttributeValueSecure (int id) const
 Returns Xerces-value of the named attribute.
 
 SUMOSAXAttributesImpl_Xerces (const SUMOSAXAttributesImpl_Xerces &src)
 Invalidated copy constructor.
 
SUMOSAXAttributesImpl_Xercesoperator= (const SUMOSAXAttributesImpl_Xerces &src)
 Invalidated assignment operator.
 

virtual methods for retrieving attribute values

std::string myObjectType
 the object type to use in error reporting
 
bool getBool (int id) const
 Returns the bool-value of the named (by its enum-value) attribute.
 
int getInt (int id) const
 Returns the int-value of the named (by its enum-value) attribute.
 
virtual long long int getLong (int id) const
 Returns the long-value of the named (by its enum-value) attribute.
 
double getFloat (int id) const
 Returns the double-value of the named (by its enum-value) attribute.
 
const std::string & getObjectType () const
 return the objecttype to which these attributes belong
 
static const std::string ENCODING = " encoding=\"UTF-8\""
 The encoding of parsed strings.
 
template<typename T >
fromString (const std::string &value) 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
 

Detailed Description

Encapsulated Xerces-SAX-attributes.

See also
SUMOSAXAttributes

Definition at line 43 of file SUMOSAXAttributesImpl_Xerces.h.

Member Typedef Documentation

◆ AttrMap

typedef std::vector<XMLCh*> SUMOSAXAttributesImpl_Xerces::AttrMap
private

Definition of a map of attribute ids to their xerces-representation.

Definition at line 175 of file SUMOSAXAttributesImpl_Xerces.h.

Constructor & Destructor Documentation

◆ SUMOSAXAttributesImpl_Xerces() [1/2]

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.

Parameters
[in]attrsThe encapsulated xerces-attributes
[in]predefinedTagsMap of attribute ids to their xerces-representation
[in]predefinedTagsMMLMap of attribute ids to their (readable) string-representation

Definition at line 41 of file SUMOSAXAttributesImpl_Xerces.cpp.

◆ ~SUMOSAXAttributesImpl_Xerces()

SUMOSAXAttributesImpl_Xerces::~SUMOSAXAttributesImpl_Xerces ( )
virtual

Destructor.

Definition at line 51 of file SUMOSAXAttributesImpl_Xerces.cpp.

◆ SUMOSAXAttributesImpl_Xerces() [2/2]

SUMOSAXAttributesImpl_Xerces::SUMOSAXAttributesImpl_Xerces ( const SUMOSAXAttributesImpl_Xerces src)
private

Invalidated copy constructor.

Member Function Documentation

◆ clone()

SUMOSAXAttributes * SUMOSAXAttributesImpl_Xerces::clone ( ) const
virtual

return a new deep-copy attributes object

Implements SUMOSAXAttributes.

Definition at line 154 of file SUMOSAXAttributesImpl_Xerces.cpp.

References SUMOSAXAttributes::getObjectType(), myAttrs, myPredefinedTagsMML, and StringUtils::transcode().

◆ emitEmptyError()

void SUMOSAXAttributes::emitEmptyError ( const std::string &  attrname,
const char *  objectid 
) const
protectedinherited

Definition at line 192 of file SUMOSAXAttributes.cpp.

References SUMOSAXAttributes::myObjectType, and WRITE_ERROR.

Referenced by SUMOSAXAttributes::get(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::getOptPeriod(), SUMOSAXAttributes::getOptSUMOTimeReporting(), SUMOSAXAttributes::getPeriod(), and SUMOSAXAttributes::getSUMOTimeReporting().

Here is the caller graph for this function:

◆ emitFormatError()

void SUMOSAXAttributes::emitFormatError ( const std::string &  attrname,
const std::string &  type,
const char *  objectid 
) const
protectedinherited

Definition at line 206 of file SUMOSAXAttributes.cpp.

References SUMOSAXAttributes::myObjectType, and WRITE_ERROR.

Referenced by SUMOSAXAttributes::get(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::getOptPeriod(), SUMOSAXAttributes::getOptSUMOTimeReporting(), SUMOSAXAttributes::getPeriod(), and SUMOSAXAttributes::getSUMOTimeReporting().

Here is the caller graph for this function:

◆ emitUngivenError()

void SUMOSAXAttributes::emitUngivenError ( const std::string &  attrname,
const char *  objectid 
) const
protectedinherited

Definition at line 178 of file SUMOSAXAttributes.cpp.

References SUMOSAXAttributes::myObjectType, and WRITE_ERROR.

Referenced by SUMOSAXAttributes::get(), SUMOSAXAttributes::getPeriod(), and SUMOSAXAttributes::getSUMOTimeReporting().

Here is the caller graph for this function:

◆ fromString() [1/18]

template<>
std::string SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

Definition at line 51 of file SUMOSAXAttributes.cpp.

◆ fromString() [2/18]

template<>
int SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

Definition at line 221 of file SUMOSAXAttributes.cpp.

References StringUtils::toInt().

◆ fromString() [3/18]

template<>
long long int SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

Definition at line 228 of file SUMOSAXAttributes.cpp.

References StringUtils::toLong().

◆ fromString() [4/18]

template<>
double SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

Definition at line 235 of file SUMOSAXAttributes.cpp.

References StringUtils::toDouble().

◆ fromString() [5/18]

template<>
bool SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

Definition at line 242 of file SUMOSAXAttributes.cpp.

References StringUtils::toBool().

◆ fromString() [6/18]

template<>
RGBColor SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

Definition at line 249 of file SUMOSAXAttributes.cpp.

References RGBColor::parseColor().

◆ fromString() [7/18]

template<>
Position SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

◆ fromString() [8/18]

template<>
PositionVector SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

◆ fromString() [9/18]

template<>
Boundary SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

◆ fromString() [10/18]

template<>
SumoXMLEdgeFunc SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

◆ fromString() [11/18]

template<>
SumoXMLNodeType SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

◆ fromString() [12/18]

template<>
RightOfWay SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

◆ fromString() [13/18]

template<>
FringeType SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

◆ fromString() [14/18]

template<>
ParkingType SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

Definition at line 363 of file SUMOSAXAttributes.cpp.

References OFFROAD, ONROAD, OPPORTUNISTIC, StringUtils::toBool(), and toString().

◆ fromString() [15/18]

template<>
std::vector< std::string > SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

Definition at line 374 of file SUMOSAXAttributes.cpp.

References StringTokenizer::getVector().

◆ fromString() [16/18]

template<>
std::vector< int > SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

Definition at line 385 of file SUMOSAXAttributes.cpp.

References StringTokenizer::getVector(), and StringUtils::toInt().

◆ fromString() [17/18]

template<>
std::vector< double > SUMOSAXAttributes::fromString ( const std::string &  value) const
inherited

Definition at line 400 of file SUMOSAXAttributes.cpp.

References StringTokenizer::getVector(), and StringUtils::toDouble().

◆ fromString() [18/18]

template<typename T >
T SUMOSAXAttributes::fromString ( const std::string &  value) const
protectedinherited

◆ get()

template<typename T >
T SUMOSAXAttributes::get ( int  attr,
const char *  objectid,
bool &  ok,
bool  report = true 
) const
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.

Parameters
[in]attrThe id of the attribute to read
[in]objectidThe name of the parsed object; used for error message generation
[out]okWhether the value could be read
[in]reportWhether errors shall be written to msg handler's error instance
Returns
The read value if given and correct; -1 if an error occurred

Definition at line 433 of file SUMOSAXAttributes.h.

References SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::emitUngivenError(), SUMOSAXAttributes::getName(), and SUMOSAXAttributes::getString().

Referenced by NIXMLPTHandler::addAccess(), NLHandler::addAssignment(), NLHandler::addCondition(), NLHandler::addConflict(), NIImporter_SUMO::addConnection(), NLHandler::addConnection(), NLNetShapeHandler::addConnection(), NIXMLConnectionsHandler::addCrossing(), NLHandler::addDeadlock(), NLHandler::addDistrict(), NLHandler::addDistrictEdge(), NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addE3Entry(), NLHandler::addE3Exit(), NIImporter_SUMO::addEdge(), NIXMLEdgesHandler::addEdge(), NLHandler::addEdgeLaneMeanData(), ROJTRTurnDefLoader::addEdgeRel(), NLHandler::addFunction(), NLHandler::addInstantE1Detector(), NIXMLNodesHandler::addJoinCluster(), NIXMLNodesHandler::addJoinExclusion(), NIImporter_SUMO::addJunction(), NLNetShapeHandler::addJunction(), NIImporter_SUMO::addLane(), NIXMLEdgesHandler::addLane(), NLHandler::addLane(), NLNetShapeHandler::addLane(), NIXMLNodesHandler::addNode(), NLHandler::addParam(), RONetHandler::addParam(), SUMORouteHandler::addParam(), NLHandler::addPhase(), NIImporter_SUMO::addPhase(), ShapeHandler::addPOI(), ShapeHandler::addPoly(), NLHandler::addPredecessorConstraint(), NIXMLPTHandler::addPTLine(), NIXMLPTHandler::addPTLineFromFlow(), NIXMLPTHandler::addPTLineRoute(), NIXMLPTHandler::addPTLineStop(), NIXMLPTHandler::addPTStop(), NIImporter_SUMO::addRequest(), NLHandler::addRequest(), RORouteHandler::addRide(), MSRouteHandler::addRideOrTransport(), NIImporter_SUMO::addRoundabout(), NIXMLEdgesHandler::addRoundabout(), NLHandler::addRoundabout(), NIXMLPTHandler::addRoute(), NLHandler::addRouteProbeDetector(), NIXMLPTHandler::addRouteStop(), NIXMLEdgesHandler::addSplit(), MSRouteHandler::addStop(), RORouteHandler::addStop(), ROJTRTurnDefLoader::addToEdge(), MSRouteHandler::addTranship(), RORouteHandler::addTransport(), NLHandler::addVTypeProbeDetector(), MSRouteHandler::addWalk(), RORouteHandler::addWalk(), NIXMLConnectionsHandler::addWalkingArea(), NLHandler::addWAUTJunction(), NLHandler::addWAUTSwitch(), NLHandler::beginE3Detector(), NLHandler::beginEdgeParsing(), ROJTRTurnDefLoader::beginFromEdge(), SUMOVehicleParserHelper::beginVTypeParsing(), NLTriggerBuilder::buildVaporizer(), NIXMLConnectionsHandler::delConnection(), NIXMLEdgesHandler::deleteEdge(), NIXMLNodesHandler::deleteNode(), NLTriggerBuilder::getLane(), NLTriggerBuilder::getPosition(), NLHandler::initJunctionLogic(), NLHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::loadLocation(), MSDevice_Vehroutes::loadState(), MSRailSignalConstraint_Predecessor::loadState(), MSDriveWay::loadState(), RODFDetectorHandler::myStartElement(), ROJTRTurnDefLoader::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(), 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(), AdditionalHandler::parseAccessAttributes(), NLTriggerBuilder::parseAndAddLotEntry(), NLTriggerBuilder::parseAndBeginParkingArea(), NLTriggerBuilder::parseAndBuildCalibrator(), NLTriggerBuilder::parseAndBuildChargingStation(), NLTriggerBuilder::parseAndBuildLaneSpeedTrigger(), NLTriggerBuilder::parseAndBuildOverheadWireClamp(), NLTriggerBuilder::parseAndBuildOverheadWireSection(), NLTriggerBuilder::parseAndBuildOverheadWireSegment(), NLTriggerBuilder::parseAndBuildRerouter(), NLTriggerBuilder::parseAndBuildStoppingPlace(), NLTriggerBuilder::parseAndBuildTractionSubstation(), AdditionalHandler::parseBusStopAttributes(), AdditionalHandler::parseCalibratorAttributes(), AdditionalHandler::parseCalibratorFlowAttributes(), SUMOVehicleParserHelper::parseCFMParams(), AdditionalHandler::parseChargingStationAttributes(), AdditionalHandler::parseClosingLaneRerouteAttributes(), AdditionalHandler::parseClosingRerouteAttributes(), SUMOVehicleParserHelper::parseCommonAttributes(), NIXMLConnectionsHandler::parseConnection(), RONetHandler::parseConnection(), AdditionalHandler::parseContainerStopAttributes(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), AdditionalHandler::parseDestProbRerouteAttributes(), RONetHandler::parseDistrict(), RONetHandler::parseDistrictEdge(), AdditionalHandler::parseE1Attributes(), AdditionalHandler::parseE1InstantAttributes(), AdditionalHandler::parseE2Attributes(), AdditionalHandler::parseE3Attributes(), RONetHandler::parseEdge(), DataHandler::parseEdgeData(), MeanDataHandler::parseEdgeMeanData(), DataHandler::parseEdgeRelationData(), AdditionalHandler::parseEntryAttributes(), AdditionalHandler::parseExitAttributes(), RouteHandler::parseFlow(), SUMOVehicleParserHelper::parseFlowAttributes(), MSRouteHandler::parseFromViaTo(), RORouteHandler::parseFromViaTo(), SUMOVehicleParserHelper::parseID(), DataHandler::parseInterval(), SUMOVehicleParserHelper::parseJMParams(), AdditionalHandler::parseJpsObstacleAttributes(), AdditionalHandler::parseJpsWalkableAreaAttributes(), RONetHandler::parseJunction(), RONetHandler::parseLane(), NIXMLConnectionsHandler::parseLaneBound(), NIXMLConnectionsHandler::parseLaneDefinition(), MeanDataHandler::parseLaneMeanData(), SUMOVehicleParserHelper::parseLCParams(), AdditionalHandler::parseOverheadWire(), AdditionalHandler::parseOverheadWireClamp(), AdditionalHandler::parseParameters(), RouteHandler::parseParameters(), AdditionalHandler::parseParkingAreaAttributes(), AdditionalHandler::parseParkingAreaRerouteAttributes(), AdditionalHandler::parseParkingSpaceAttributes(), AdditionalHandler::parsePOIAttributes(), AdditionalHandler::parsePolyAttributes(), AdditionalHandler::parseRerouterAttributes(), RouteHandler::parseRoute(), RouteHandler::parseRouteDistribution(), AdditionalHandler::parseRouteProbeAttributes(), AdditionalHandler::parseRouteProbRerouteAttributes(), AGActivityGenHandler::parseStation(), SUMORouteHandler::parseStop(), RouteHandler::parseStopParameters(), RONetHandler::parseStoppingPlace(), ODDistrictHandler::parseTAZ(), AdditionalHandler::parseTAZAttributes(), DataHandler::parseTAZRelationData(), AdditionalHandler::parseTAZSinkAttributes(), AdditionalHandler::parseTAZSourceAttributes(), AdditionalHandler::parseTractionSubstation(), AdditionalHandler::parseTrainStopAttributes(), RouteHandler::parseTrip(), AdditionalHandler::parseVaporizerAttributes(), AdditionalHandler::parseVariableSpeedSignAttributes(), SUMOVehicleParserHelper::parseVehicleAttributes(), RouteHandler::parseVTypeDistribution(), MSRouteHandler::parseWalkPositions(), RORouteHandler::parseWalkPositions(), NIXMLNodesHandler::processNodeType(), NIXMLNodesHandler::processTrafficLightDefinitions(), NIImporter_SUMO::readPosition(), NIXMLTrafficLightsHandler::removeTlConnection(), NIXMLTrafficLightsHandler::retrieveEdge(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NLHandler::setLocation(), RONetHandler::setLocation(), NIXMLEdgesHandler::setNodes(), SAXWeightsHandler::tryParseEdgeRel(), and SAXWeightsHandler::tryParseTazRel().

◆ getAttributeNames()

std::vector< std::string > SUMOSAXAttributesImpl_Xerces::getAttributeNames ( ) const
virtual

Retrieves all attribute names.

Implements SUMOSAXAttributes.

Definition at line 144 of file SUMOSAXAttributesImpl_Xerces.cpp.

References myAttrs, and StringUtils::transcode().

◆ getAttributeValueSecure()

const XMLCh * SUMOSAXAttributesImpl_Xerces::getAttributeValueSecure ( int  id) const
private

Returns Xerces-value of the named attribute.

It is assumed that this attribute is within the stored attributes.

Parameters
[in]idThe id of the attribute to retrieve the vale of
Returns
The xerces-value of the attribute

Definition at line 87 of file SUMOSAXAttributesImpl_Xerces.cpp.

References myAttrs, and myPredefinedTags.

Referenced by getString(), and getStringSecure().

Here is the caller graph for this function:

◆ getBool()

bool SUMOSAXAttributes::getBool ( int  id) const
inlineinherited

Returns the bool-value of the named (by its enum-value) attribute.

Tries to retrieve the attribute from 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.

Parameters
[in]idThe id of the attribute to return the value of
Returns
The attribute's value as a bool, if it could be read and parsed
Exceptions
EmptyDataIf the attribute is not known or the attribute value is an empty string
BoolFormatExceptionIf the attribute value can not be parsed to a bool

Definition at line 223 of file SUMOSAXAttributes.h.

References SUMOSAXAttributes::getString(), and StringUtils::toBool().

◆ getFloat() [1/2]

double SUMOSAXAttributesImpl_Xerces::getFloat ( const std::string &  id) const
virtual

Returns the double-value of the named attribute.

Tries to retrieve the attribute from 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.

Parameters
[in]idThe name of the attribute to return the value of
Returns
The attribute's value as a float, if it could be read and parsed
Exceptions
EmptyDataIf the attribute is not known or the attribute value is an empty string
NumberFormatExceptionIf the attribute value can not be parsed to an double

Implements SUMOSAXAttributes.

Definition at line 95 of file SUMOSAXAttributesImpl_Xerces.cpp.

References myAttrs, StringUtils::toDouble(), and StringUtils::transcode().

◆ getFloat() [2/2]

double SUMOSAXAttributes::getFloat ( int  id) const
inlineinherited

Returns the double-value of the named (by its enum-value) attribute.

Tries to retrieve the attribute from 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.

Parameters
[in]idThe id of the attribute to return the value of
Returns
The attribute's value as a float, if it could be read and parsed
Exceptions
EmptyDataIf the attribute is not known or the attribute value is an empty string
NumberFormatExceptionIf the attribute value can not be parsed to an double

Definition at line 312 of file SUMOSAXAttributes.h.

References SUMOSAXAttributes::getString(), and StringUtils::toDouble().

Referenced by NIImporter_SUMO::addLane(), MSStateHandler::closeVehicle(), MSVehicle::loadState(), MSStateHandler::myEndElement(), VehicleEngineHandler::myStartElement(), TrajectoriesHandler::myStartElement(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseCityGates(), AGActivityGenHandler::parseClosingHour(), AGActivityGenHandler::parseOpeningHour(), AGActivityGenHandler::parseSchool(), AGActivityGenHandler::parseStreets(), SAXWeightsHandler::tryParse(), SAXWeightsHandler::tryParseEdgeRel(), and SAXWeightsHandler::tryParseTazRel().

Here is the caller graph for this function:

◆ getInt()

int SUMOSAXAttributes::getInt ( int  id) const
inlineinherited

Returns the int-value of the named (by its enum-value) attribute.

Tries to retrieve the attribute from 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.

Parameters
[in]idThe id of the attribute to return the value of
Returns
The attribute's value as an int, if it could be read and parsed
Exceptions
EmptyDataIf the attribute is not known or the attribute value is an empty string
NumberFormatExceptionIf the attribute value can not be parsed to an int

Definition at line 242 of file SUMOSAXAttributes.h.

References SUMOSAXAttributes::getString(), and StringUtils::toInt().

Referenced by MSStateHandler::myEndElement(), VehicleEngineHandler::myStartElement(), MSStateHandler::myStartElement(), AGActivityGenHandler::parseBracket(), AGActivityGenHandler::parseBusLine(), AGActivityGenHandler::parseBusStation(), AGActivityGenHandler::parseClosingHour(), AGActivityGenHandler::parseFrequency(), AGActivityGenHandler::parseGeneralCityInfo(), AGActivityGenHandler::parseOpeningHour(), and AGActivityGenHandler::parseSchool().

Here is the caller graph for this function:

◆ getLong()

virtual long long int SUMOSAXAttributes::getLong ( int  id) const
inlinevirtualinherited

Returns the long-value of the named (by its enum-value) attribute.

Tries to retrieve the attribute from 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.

Parameters
[in]idThe id of the attribute to return the value of
Returns
The attribute's value as an int, if it could be read and parsed
Exceptions
EmptyDataIf the attribute is not known or the attribute value is an empty string
NumberFormatExceptionIf the attribute value can not be parsed to an int

Definition at line 262 of file SUMOSAXAttributes.h.

References SUMOSAXAttributes::getString(), and StringUtils::toLong().

Referenced by MSVehicleTransfer::loadState().

Here is the caller graph for this function:

◆ getName()

std::string SUMOSAXAttributesImpl_Xerces::getName ( int  attr) const
virtual

Converts the given attribute id into a man readable string.

Returns a "?" if the attribute is not known.

Parameters
[in]attrThe id of the attribute to return the name of
Returns
The name of the described attribute

Implements SUMOSAXAttributes.

Definition at line 127 of file SUMOSAXAttributesImpl_Xerces.cpp.

References myPredefinedTagsMML.

◆ getObjectType()

const std::string & SUMOSAXAttributes::getObjectType ( ) const
inlineinherited

return the objecttype to which these attributes belong

Definition at line 367 of file SUMOSAXAttributes.h.

References SUMOSAXAttributes::myObjectType.

Referenced by SUMOSAXAttributesImpl_Cached::clone(), clone(), SUMOVehicleParserHelper::parseGuiShape(), ODDistrictHandler::parseTAZ(), and SUMOVehicleParserHelper::parseVehicleClass().

Here is the caller graph for this function:

◆ getOpt()

template<typename T >
T SUMOSAXAttributes::getOpt ( int  attr,
const char *  objectid,
bool &  ok,
defaultValue = T(),
bool  report = true 
) const
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.

Parameters
[in]attrThe id of the attribute to read
[in]objectidThe name of the parsed object; used for error message generation
[out]okWhether the value could be read
[in]defaultValueThe value to return if the attribute is not within the element
[in]reportWhether errors shall be written to msg handler's error instance
Returns
The read value if given and correct; the default value if the attribute does not exist; -1 if an error occurred

Definition at line 459 of file SUMOSAXAttributes.h.

References SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::getName(), and SUMOSAXAttributes::getString().

Referenced by NIXMLPTHandler::addAccess(), NLTriggerBuilder::addAccess(), NLDiscreteEventBuilder::addAction(), NIImporter_SUMO::addConnection(), NLHandler::addConnection(), NIXMLConnectionsHandler::addCrossing(), NLHandler::addDistrict(), NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addE3Entry(), NLHandler::addE3Exit(), NIImporter_SUMO::addEdge(), NIXMLEdgesHandler::addEdge(), NLHandler::addEdgeLaneMeanData(), NLHandler::addInstantE1Detector(), NIXMLNodesHandler::addJoinCluster(), NIImporter_SUMO::addJunction(), NLNetShapeHandler::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(), NIXMLConnectionsHandler::addProhibition(), NIXMLPTHandler::addPTLine(), NIXMLPTHandler::addPTLineFromFlow(), NIXMLPTHandler::addPTStop(), NLHandler::addRequest(), RORouteHandler::addRide(), MSRouteHandler::addRideOrTransport(), NLHandler::addRouteProbeDetector(), NIXMLEdgesHandler::addSplit(), MSRouteHandler::addStop(), RORouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), MSRouteHandler::addTranship(), 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::getParkingArea(), NLTriggerBuilder::getPosition(), NLHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), MSVehicleTransfer::loadState(), MSDriveWay::loadState(), RODFDetectorHandler::myStartElement(), MSStateHandler::myStartElement(), MSCalibrator::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), NIImporter_OpenDrive::myStartElement(), NIImporter_SUMO::myStartElement(), NIXMLTypesHandler::myStartElement(), NLHandler::myStartElement(), PCLoaderOSM::NodesHandler::myStartElement(), PCLoaderOSM::RelationsHandler::myStartElement(), PCLoaderOSM::EdgesHandler::myStartElement(), PCLoaderXML::myStartElement(), PCTypeDefHandler::myStartElement(), TrajectoriesHandler::myStartElement(), GUISettingsHandler::myStartElement(), SAXWeightsHandler::myStartElement(), MSDevice_FCDReplay::FCDHandler::myStartElement(), NIImporter_OpenStreetMap::NodesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::RelationHandler::myStartElement(), NLHandler::openJunction(), MSRouteHandler::openRoute(), RORouteHandler::openRoute(), RORouteHandler::openRouteDistribution(), RONetHandler::parseAccess(), AdditionalHandler::parseAccessAttributes(), NLTriggerBuilder::parseAndAddLotEntry(), NLTriggerBuilder::parseAndBeginParkingArea(), NLTriggerBuilder::parseAndBuildCalibrator(), NLTriggerBuilder::parseAndBuildChargingStation(), NLTriggerBuilder::parseAndBuildOverheadWireSection(), NLTriggerBuilder::parseAndBuildOverheadWireSegment(), NLTriggerBuilder::parseAndBuildRerouter(), NLTriggerBuilder::parseAndBuildStoppingPlace(), NLTriggerBuilder::parseAndBuildTractionSubstation(), AdditionalHandler::parseBusStopAttributes(), AdditionalHandler::parseCalibratorAttributes(), AdditionalHandler::parseChargingStationAttributes(), AdditionalHandler::parseClosingLaneRerouteAttributes(), AdditionalHandler::parseClosingRerouteAttributes(), NIXMLConnectionsHandler::parseConnection(), RONetHandler::parseConnection(), AdditionalHandler::parseContainerStopAttributes(), AdditionalHandler::parseDestProbRerouteAttributes(), AdditionalHandler::parseE1Attributes(), AdditionalHandler::parseE1InstantAttributes(), AdditionalHandler::parseE2Attributes(), AdditionalHandler::parseE3Attributes(), RONetHandler::parseEdge(), MeanDataHandler::parseEdgeMeanData(), AdditionalHandler::parseEntryAttributes(), AdditionalHandler::parseExitAttributes(), RouteHandler::parseFlow(), MSRouteHandler::parseFromViaTo(), RORouteHandler::parseFromViaTo(), AGActivityGenHandler::parseGeneralCityInfo(), SUMOVehicleParserHelper::parseGuiShape(), AdditionalHandler::parseJpsObstacleAttributes(), AdditionalHandler::parseJpsWalkableAreaAttributes(), RONetHandler::parseJunction(), RONetHandler::parseLane(), NIXMLConnectionsHandler::parseLaneBound(), MeanDataHandler::parseLaneMeanData(), AdditionalHandler::parseOverheadWire(), AGActivityGenHandler::parseParameters(), AdditionalHandler::parseParkingAreaAttributes(), AdditionalHandler::parseParkingAreaRerouteAttributes(), AdditionalHandler::parseParkingSpaceAttributes(), RouteHandler::parsePersonTrip(), AdditionalHandler::parsePOIAttributes(), AdditionalHandler::parsePolyAttributes(), AdditionalHandler::parseRerouterAttributes(), RouteHandler::parseRide(), RouteHandler::parseRoute(), RouteHandler::parseRouteDistribution(), AdditionalHandler::parseRouteProbeAttributes(), AdditionalHandler::parseRouteProbRerouteAttributes(), SUMORouteHandler::parseStop(), RouteHandler::parseStopParameters(), RONetHandler::parseStoppingPlace(), AdditionalHandler::parseTAZAttributes(), AdditionalHandler::parseTractionSubstation(), AdditionalHandler::parseTrainStopAttributes(), RouteHandler::parseTranship(), RouteHandler::parseTransport(), RouteHandler::parseTrip(), AdditionalHandler::parseVaporizerAttributes(), AdditionalHandler::parseVariableSpeedSignAttributes(), AdditionalHandler::parseVariableSpeedSignStepAttributes(), SUMOVehicleParserHelper::parseVehicleAttributes(), SUMOVehicleParserHelper::parseVehicleClass(), RouteHandler::parseVTypeDistribution(), RouteHandler::parseWalk(), RORouteHandler::parseWalkPositions(), CommonXMLStructure::PlanParameters::PlanParameters(), NIXMLNodesHandler::processNodeType(), NIXMLNodesHandler::processTrafficLightDefinitions(), NIImporter_SUMO::readPosition(), RORouteHandler::retrieveStoppingPlace(), MSRouteHandler::retrieveStoppingPlace(), StopOffset::StopOffset(), NIXMLEdgesHandler::tryGetLaneSpread(), and NIXMLEdgesHandler::tryGetShape().

◆ getOptPeriod()

SUMOTime SUMOSAXAttributes::getOptPeriod ( const char *  objectid,
bool &  ok,
SUMOTime  defaultValue,
bool  report = true 
) const
inherited

Tries to read the SUMOTime 'period' attribute.

If 'period' cannot be found, tries 'freq' as an alias.

If both attributes do not exist 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.

Parameters
[in]objectidThe name of the parsed object; used for error message generation
[out]okWhether the value could be read
[in]defaultValueThe value to return if the attribute is not within the element
[in]reportWhether errors shall be written to msg handler's error instance
Returns
The read value if given and correct; the default value if the attribute does not exist; -1 if an error occurred

Definition at line 147 of file SUMOSAXAttributes.cpp.

References SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::getName(), SUMOSAXAttributes::getString(), string2time(), SUMO_ATTR_FREQUENCY, and SUMO_ATTR_PERIOD.

Referenced by NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addEdgeLaneMeanData(), NLHandler::addRouteProbeDetector(), NLHandler::addVTypeProbeDetector(), NLHandler::beginE3Detector(), NLTriggerBuilder::parseAndBuildCalibrator(), AdditionalHandler::parseCalibratorAttributes(), AdditionalHandler::parseE1Attributes(), AdditionalHandler::parseE2Attributes(), AdditionalHandler::parseE3Attributes(), and AdditionalHandler::parseRouteProbeAttributes().

Here is the caller graph for this function:

◆ getOptSUMOTimeReporting()

SUMOTime SUMOSAXAttributes::getOptSUMOTimeReporting ( int  attr,
const char *  objectid,
bool &  ok,
SUMOTime  defaultValue,
bool  report = true 
) const
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.

Parameters
[in]attrThe id of the attribute to read
[in]objectidThe name of the parsed object; used for error message generation
[out]okWhether the value could be read
[in]defaultValueThe value to return if the attribute is not within the element
[in]reportWhether errors shall be written to msg handler's error instance
Returns
The read value if given and correct; the default value if the attribute does not exist; -1 if an error occurred

Definition at line 123 of file SUMOSAXAttributes.cpp.

References SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::getName(), SUMOSAXAttributes::getString(), and string2time().

Referenced by NLHandler::addE2Detector(), NLHandler::addEdgeLaneMeanData(), NLHandler::addMesoEdgeType(), MSRouteHandler::addPersonTrip(), RORouteHandler::addPersonTrip(), NLHandler::addPhase(), NIImporter_SUMO::addPhase(), MSRouteHandler::addRideOrTransport(), NLHandler::addRouteProbeDetector(), MSRouteHandler::addWalk(), NLHandler::beginE3Detector(), NLHandler::initTrafficLightLogic(), MSStateHandler::myStartElement(), MSCalibrator::myStartElement(), MSTriggeredRerouter::myStartElement(), GUISettingsHandler::myStartElement(), MSRouteHandler::openRoute(), RORouteHandler::openRoute(), NLHandler::openWAUT(), NLTriggerBuilder::parseAndBuildChargingStation(), AdditionalHandler::parseChargingStationAttributes(), AdditionalHandler::parseE2Attributes(), AdditionalHandler::parseE3Attributes(), MeanDataHandler::parseEdgeMeanData(), MeanDataHandler::parseLaneMeanData(), AdditionalHandler::parseRerouterAttributes(), RouteHandler::parseRoute(), AdditionalHandler::parseRouteProbeAttributes(), SUMORouteHandler::parseStop(), RouteHandler::parseStopParameters(), RouteHandler::parseTranship(), and RouteHandler::parseWalk().

Here is the caller graph for this function:

◆ getPeriod()

SUMOTime SUMOSAXAttributes::getPeriod ( const char *  objectid,
bool &  ok,
bool  report = true 
) const
inherited

Tries to read the SUMOTime 'period' attribute.

If 'period' cannot be found, tries 'freq' as an alias.

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.

Parameters
[in]objectidThe name of the parsed object; used for error message generation
[out]okWhether the value could be read
[in]reportWhether errors shall be written to msg handler's error instance
Returns
The read value if given and correct; -1 if an error occurred

Definition at line 88 of file SUMOSAXAttributes.cpp.

References SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::emitUngivenError(), SUMOSAXAttributes::getName(), SUMOSAXAttributes::getString(), string2time(), SUMO_ATTR_FREQUENCY, and SUMO_ATTR_PERIOD.

Referenced by NLHandler::addE2Detector().

Here is the caller graph for this function:

◆ getString()

std::string SUMOSAXAttributesImpl_Xerces::getString ( int  id,
bool *  isPresent = nullptr 
) const
virtual

Returns the string-value of the named (by its enum-value) attribute.

Tries to retrieve the attribute from 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.

Parameters
[in]idThe id of the attribute to return the value of
Returns
The attribute's value as a string, if it could be read and parsed
Exceptions
EmptyDataIf the attribute is not known or the attribute value is an empty string

Implements SUMOSAXAttributes.

Definition at line 64 of file SUMOSAXAttributesImpl_Xerces.cpp.

References getAttributeValueSecure(), and StringUtils::transcode().

Referenced by getStringSecure(), GenericHandler::startElement(), and GenericSAXHandler::startElement().

Here is the caller graph for this function:

◆ getStringSecure() [1/2]

std::string SUMOSAXAttributesImpl_Xerces::getStringSecure ( const std::string &  id,
const std::string &  def 
) const
virtual

Returns the string-value of the named (by its enum-value) attribute.

Tries to retrieve the attribute from the attribute list. If the attribute is ==0, TplConvert<XMLCh>::_2strSec returns the default value.

Parameters
[in]idThe name of the attribute to return the value of
[in]defThe default value to return if the attribute is not in attributes
Returns
The attribute's value as a string, if it could be read and parsed

Implements SUMOSAXAttributes.

Definition at line 113 of file SUMOSAXAttributesImpl_Xerces.cpp.

References myAttrs, and StringUtils::transcode().

◆ getStringSecure() [2/2]

std::string SUMOSAXAttributesImpl_Xerces::getStringSecure ( int  id,
const std::string &  def 
) const
virtual

Returns the string-value of the named (by its enum-value) attribute.

Tries to retrieve the attribute from 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.

Parameters
[in]idThe id of the attribute to return the value of
[in]defThe default value to return if the attribute is not in attributes
Returns
The attribute's value as a string, if it could be read and parsed
Exceptions
EmptyDataIf the attribute is not known or the attribute value is an empty string

Implements SUMOSAXAttributes.

Definition at line 75 of file SUMOSAXAttributesImpl_Xerces.cpp.

References getAttributeValueSecure(), and getString().

◆ getSUMOTimeReporting()

SUMOTime SUMOSAXAttributes::getSUMOTimeReporting ( int  attr,
const char *  objectid,
bool &  ok,
bool  report = true 
) const
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.

Parameters
[in]attrThe id of the attribute to read
[in]objectidThe name of the parsed object; used for error message generation
[out]okWhether the value could be read
[in]reportWhether errors shall be written to msg handler's error instance
Returns
The read value if given and correct; -1 if an error occurred

Definition at line 60 of file SUMOSAXAttributes.cpp.

References SUMOSAXAttributes::emitEmptyError(), SUMOSAXAttributes::emitFormatError(), SUMOSAXAttributes::emitUngivenError(), SUMOSAXAttributes::getName(), SUMOSAXAttributes::getString(), and string2time().

Referenced by NLHandler::addPhase(), NLHandler::addWAUTSwitch(), SUMOVehicleParserHelper::beginVTypeParsing(), NLTriggerBuilder::buildVaporizer(), GUINet::DiscoverAttributes::myStartElement(), MSCalibrator::myStartElement(), MSLaneSpeedTrigger::myStartElement(), TrajectoriesHandler::myStartElement(), GUISettingsHandler::myStartElement(), SUMORouteHandler::myStartElement(), SAXWeightsHandler::myStartElement(), MSDevice_FCDReplay::FCDHandler::myStartElement(), AdditionalHandler::parseCalibratorFlowAttributes(), SUMOVehicleParserHelper::parseFlowAttributes(), RouteHandler::parseInterval(), AdditionalHandler::parseRerouterIntervalAttributes(), AdditionalHandler::parseVaporizerAttributes(), and AdditionalHandler::parseVariableSpeedSignStepAttributes().

Here is the caller graph for this function:

◆ hasAttribute() [1/2]

bool SUMOSAXAttributesImpl_Xerces::hasAttribute ( const std::string &  id) const
virtual

Returns the information whether the named attribute is within the current list.

Implements SUMOSAXAttributes.

Definition at line 104 of file SUMOSAXAttributesImpl_Xerces.cpp.

References myAttrs.

◆ hasAttribute() [2/2]

bool SUMOSAXAttributesImpl_Xerces::hasAttribute ( int  id) const
virtual

Returns the information whether the named (by its enum-value) attribute is within the current list.

Parameters
[in]idThe id of the searched attribute
Returns
Whether the attribute is within the attributes

Implements SUMOSAXAttributes.

Definition at line 56 of file SUMOSAXAttributesImpl_Xerces.cpp.

References myAttrs, and myPredefinedTags.

◆ operator=()

SUMOSAXAttributesImpl_Xerces & SUMOSAXAttributesImpl_Xerces::operator= ( const SUMOSAXAttributesImpl_Xerces src)
private

Invalidated assignment operator.

◆ serialize()

void SUMOSAXAttributesImpl_Xerces::serialize ( std::ostream &  os) const
virtual

Prints all attribute names and values into the given stream.

Parameters
[in]osThe stream to use

Implements SUMOSAXAttributes.

Definition at line 135 of file SUMOSAXAttributesImpl_Xerces.cpp.

References myAttrs, and StringUtils::transcode().

Field Documentation

◆ ENCODING

const std::string SUMOSAXAttributes::ENCODING = " encoding=\"UTF-8\""
staticinherited

The encoding of parsed strings.

Definition at line 377 of file SUMOSAXAttributes.h.

Referenced by OptionsCont::writeXMLHeader().

◆ myAttrs

const XERCES_CPP_NAMESPACE::Attributes& SUMOSAXAttributesImpl_Xerces::myAttrs
private

◆ myObjectType

std::string SUMOSAXAttributes::myObjectType
privateinherited

◆ myPredefinedTags

const AttrMap& SUMOSAXAttributesImpl_Xerces::myPredefinedTags
private

Map of attribute ids to their xerces-representation.

Definition at line 177 of file SUMOSAXAttributesImpl_Xerces.h.

Referenced by getAttributeValueSecure(), and hasAttribute().

◆ myPredefinedTagsMML

const std::vector<std::string>& SUMOSAXAttributesImpl_Xerces::myPredefinedTagsMML
private

Map of attribute ids to their (readable) string-representation.

Definition at line 180 of file SUMOSAXAttributesImpl_Xerces.h.

Referenced by clone(), and getName().


The documentation for this class was generated from the following files: