Eclipse SUMO - Simulation of Urban MObility
|
The XML-Handler for network loading. More...
#include <CommonHandler.h>
Public Member Functions | |
CommonHandler () | |
Constructor. | |
bool | isErrorCreatingElement () const |
get flag for mark if a element wasn't created | |
virtual | ~CommonHandler () |
Destructor. | |
Protected Member Functions | |
void | parseParameters (const SUMOSAXAttributes &attrs) |
parse generic parameters | |
bool | writeError (const std::string &error) |
write error and enable error creating element | |
bool | writeErrorDuplicated (const SumoXMLTag tag, const std::string &id, const SumoXMLTag checkedTag) |
write error "duplicated additional" | |
bool | writeErrorInvalidDistribution (const SumoXMLTag tag, const std::string &id) |
write error "invalid distribution" | |
bool | writeErrorInvalidLanes (const SumoXMLTag tag, const std::string &id) |
write error "invalid list of lanes" | |
bool | writeErrorInvalidParent (const SumoXMLTag tag, const std::string &id, const SumoXMLTag parentTag, const std::string &parentID) |
write error "invalid parent element" giving ids of current and parent element | |
bool | writeErrorInvalidParent (const SumoXMLTag tag, const SumoXMLTag parentTag) |
write error "invalid parent element" without giving IDs | |
bool | writeErrorInvalidParent (const SumoXMLTag tag, const SumoXMLTag parentTag, const std::string &parentID) |
write error "invalid parent element" giving only the id of parent element | |
bool | writeErrorInvalidPosition (const SumoXMLTag tag, const std::string &id) |
write error "invalid position" | |
check functions | |
check parsed parents | |
void | checkParsedParent (const SumoXMLTag currentTag, const std::vector< SumoXMLTag > &parentTags, bool &ok) |
bool | checkListOfVehicleTypes (const SumoXMLTag tag, const std::string &id, const std::vector< std::string > &vTypeIDs) |
check list of IDs | |
bool | checkNegative (const SumoXMLTag tag, const std::string &id, const SumoXMLAttr attribute, const int value, const bool canBeZero) |
check if the given int value is NOT negative | |
bool | checkNegative (const SumoXMLTag tag, const std::string &id, const SumoXMLAttr attribute, const double value, const bool canBeZero) |
check if the given double value is NOT negative | |
bool | checkNegative (const SumoXMLTag tag, const std::string &id, const SumoXMLAttr attribute, const SUMOTime value, const bool canBeZero) |
check if the given SUMOTime value is NOT negative | |
bool | checkFileName (const SumoXMLTag tag, const std::string &id, const SumoXMLAttr attribute, const std::string &value) |
check if the given filename is valid | |
bool | checkValidAdditionalID (const SumoXMLTag tag, const std::string &value) |
check if the given additional ID is valid | |
bool | checkValidDetectorID (const SumoXMLTag tag, const std::string &value) |
check if the given detector ID is valid | |
bool | checkValidDemandElementID (const SumoXMLTag tag, const std::string &value) |
check if the given demand elmement ID is valid | |
Protected Attributes | |
CommonXMLStructure | myCommonXMLStructure |
common XML Structure | |
bool | myErrorCreatingElement = false |
flag for mark if a element wasn't created | |
Private Member Functions | |
CommonHandler (const CommonHandler &s)=delete | |
invalidate copy constructor | |
CommonHandler & | operator= (const CommonHandler &s)=delete |
invalidate assignment operator | |
The XML-Handler for network loading.
The SAX2-handler responsible for parsing networks and routes to load. This is an extension of the MSRouteHandler as routes and vehicles may also be loaded from network descriptions.
Definition at line 37 of file CommonHandler.h.
CommonHandler::CommonHandler | ( | ) |
Constructor.
Definition at line 33 of file CommonHandler.cpp.
|
virtual |
Destructor.
Definition at line 37 of file CommonHandler.cpp.
|
privatedelete |
invalidate copy constructor
|
protected |
check if the given filename is valid
Definition at line 175 of file CommonHandler.cpp.
References SUMOXMLDefinitions::isValidFilename(), TLF, toString(), and writeError().
Referenced by GNEAdditionalHandler::buildDetectorE1Instant(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildE1Detector(), GNEAdditionalHandler::buildMultiLaneDetectorE2(), GNEAdditionalHandler::buildPOI(), GNEAdditionalHandler::buildPOIGeo(), GNEAdditionalHandler::buildPOILane(), GNEAdditionalHandler::buildRouteProbe(), and GNEAdditionalHandler::buildSingleLaneDetectorE2().
|
protected |
check list of IDs
Definition at line 110 of file CommonHandler.cpp.
References SUMOXMLDefinitions::isValidTypeID(), TLF, toString(), and writeError().
Referenced by GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildE1Detector(), GNEAdditionalHandler::buildMultiLaneDetectorE2(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildSingleLaneDetectorE2(), and GNEAdditionalHandler::buildVariableSpeedSign().
|
protected |
check if the given double value is NOT negative
Definition at line 139 of file CommonHandler.cpp.
References TLF, toString(), and writeError().
|
protected |
check if the given int value is NOT negative
Definition at line 121 of file CommonHandler.cpp.
References TLF, toString(), and writeError().
Referenced by GNEAdditionalHandler::buildAccess(), GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildE1Detector(), GNEAdditionalHandler::buildEdgeCalibrator(), GNEAdditionalHandler::buildLaneCalibrator(), GNEAdditionalHandler::buildMultiLaneDetectorE2(), GNEAdditionalHandler::buildParkingArea(), GNEAdditionalHandler::buildParkingSpace(), GNEAdditionalHandler::buildPOI(), GNEAdditionalHandler::buildPOIGeo(), GNEAdditionalHandler::buildPOILane(), GNEAdditionalHandler::buildPolygon(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildRerouterInterval(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildSingleLaneDetectorE2(), GNEAdditionalHandler::buildTractionSubstation(), GNEAdditionalHandler::buildTrainStop(), GNERouteHandler::buildTranship(), GNEAdditionalHandler::buildVaporizer(), GNEAdditionalHandler::buildVariableSpeedSignStep(), GNERouteHandler::buildWalk(), AdditionalHandler::parseDestProbRerouteAttributes(), AdditionalHandler::parseParkingAreaRerouteAttributes(), AdditionalHandler::parseRerouterAttributes(), RouteHandler::parseRoute(), and AdditionalHandler::parseRouteProbRerouteAttributes().
|
protected |
check if the given SUMOTime value is NOT negative
Definition at line 157 of file CommonHandler.cpp.
References time2string(), TLF, toString(), and writeError().
|
protected |
Definition at line 79 of file CommonHandler.cpp.
References CommonXMLStructure::getCurrentSumoBaseObject(), CommonXMLStructure::SumoBaseObject::getParentSumoBaseObject(), CommonXMLStructure::SumoBaseObject::getStringAttribute(), CommonXMLStructure::SumoBaseObject::getTag(), CommonXMLStructure::SumoBaseObject::hasStringAttribute(), myCommonXMLStructure, SUMO_ATTR_ID, SUMO_TAG_NOTHING, TLF, toString(), and writeError().
Referenced by AdditionalHandler::parseAccessAttributes(), AdditionalHandler::parseClosingLaneRerouteAttributes(), AdditionalHandler::parseClosingRerouteAttributes(), AdditionalHandler::parseDestProbRerouteAttributes(), AdditionalHandler::parseEntryAttributes(), AdditionalHandler::parseExitAttributes(), AdditionalHandler::parseParkingAreaRerouteAttributes(), AdditionalHandler::parseParkingSpaceAttributes(), RouteHandler::parsePersonTrip(), AdditionalHandler::parseRerouterIntervalAttributes(), RouteHandler::parseRide(), AdditionalHandler::parseRouteProbRerouteAttributes(), RouteHandler::parseStop(), AdditionalHandler::parseTAZSinkAttributes(), AdditionalHandler::parseTAZSourceAttributes(), RouteHandler::parseTranship(), RouteHandler::parseTransport(), AdditionalHandler::parseVariableSpeedSignStepAttributes(), and RouteHandler::parseWalk().
|
protected |
check if the given additional ID is valid
Definition at line 185 of file CommonHandler.cpp.
References SUMOXMLDefinitions::isValidVehicleID(), TLF, toString(), and writeError().
Referenced by GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildContainerStop(), GNEDataHandler::buildDataSet(), GNEAdditionalHandler::buildEdgeCalibrator(), GNEMeanDataHandler::buildEdgeMeanData(), GNEAdditionalHandler::buildJpsObstacle(), GNEAdditionalHandler::buildJpsWalkableArea(), GNEAdditionalHandler::buildLaneCalibrator(), GNEMeanDataHandler::buildLaneMeanData(), GNEAdditionalHandler::buildOverheadWire(), GNEAdditionalHandler::buildParkingArea(), GNEAdditionalHandler::buildPOI(), GNEAdditionalHandler::buildPOIGeo(), GNEAdditionalHandler::buildPOILane(), GNEAdditionalHandler::buildPolygon(), GNEAdditionalHandler::buildRerouter(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildTAZ(), GNEAdditionalHandler::buildTractionSubstation(), GNEAdditionalHandler::buildTrainStop(), GNEAdditionalHandler::buildVaporizer(), and GNEAdditionalHandler::buildVariableSpeedSign().
|
protected |
check if the given demand elmement ID is valid
Definition at line 209 of file CommonHandler.cpp.
References SUMOXMLDefinitions::isValidVehicleID(), TLF, toString(), and writeError().
Referenced by GNERouteHandler::buildContainer(), GNERouteHandler::buildContainerFlow(), GNERouteHandler::buildEmbeddedRoute(), GNERouteHandler::buildFlow(), GNERouteHandler::buildFlowJunctions(), GNERouteHandler::buildFlowOverRoute(), GNERouteHandler::buildFlowTAZs(), GNERouteHandler::buildPerson(), GNERouteHandler::buildPersonFlow(), GNERouteHandler::buildRoute(), GNERouteHandler::buildRouteDistribution(), GNERouteHandler::buildTrip(), GNERouteHandler::buildTripJunctions(), GNERouteHandler::buildTripTAZs(), GNERouteHandler::buildVehicleOverRoute(), GNERouteHandler::buildVType(), and GNERouteHandler::buildVTypeDistribution().
|
protected |
check if the given detector ID is valid
Definition at line 197 of file CommonHandler.cpp.
References SUMOXMLDefinitions::isValidDetectorID(), TLF, toString(), and writeError().
Referenced by GNEAdditionalHandler::buildDetectorE1Instant(), GNEAdditionalHandler::buildDetectorE3(), GNEAdditionalHandler::buildE1Detector(), GNEAdditionalHandler::buildMultiLaneDetectorE2(), and GNEAdditionalHandler::buildSingleLaneDetectorE2().
bool CommonHandler::isErrorCreatingElement | ( | ) | const |
get flag for mark if a element wasn't created
Definition at line 41 of file CommonHandler.cpp.
References myErrorCreatingElement.
Referenced by GNEGeneralHandler::isErrorCreatingElement(), GNEApplicationWindow::loadDataElements(), and GNEApplicationWindow::onCmdOpenDataElements().
|
privatedelete |
invalidate assignment operator
|
protected |
parse generic parameters
Definition at line 47 of file CommonHandler.cpp.
References SUMOSAXAttributes::get(), CommonXMLStructure::getCurrentSumoBaseObject(), CommonXMLStructure::SumoBaseObject::getParentSumoBaseObject(), SUMOSAXAttributes::getString(), SUMOSAXAttributes::hasAttribute(), SUMOXMLDefinitions::isValidParameterKey(), myCommonXMLStructure, SUMO_ATTR_KEY, SUMO_ATTR_VALUE, SUMO_TAG_NOTHING, SUMO_TAG_PARAM, SUMO_TAG_ROOTFILE, TL, TLF, toString(), WRITE_DEBUG, and writeError().
Referenced by AdditionalHandler::beginParseAttributes(), and RouteHandler::beginParseAttributes().
|
protected |
write error and enable error creating element
Definition at line 221 of file CommonHandler.cpp.
References myErrorCreatingElement, and WRITE_ERROR.
Referenced by AdditionalHandler::beginParseAttributes(), MeanDataHandler::beginParseAttributes(), GNEAdditionalHandler::buildAccess(), GNERouteHandler::buildContainer(), GNERouteHandler::buildContainerFlow(), GNERouteHandler::buildContainerStop(), GNEDataHandler::buildEdgeRelationData(), GNERouteHandler::buildEmbeddedRoute(), GNERouteHandler::buildFlow(), GNERouteHandler::buildFlowJunctions(), GNERouteHandler::buildFlowOverRoute(), GNERouteHandler::buildFlowTAZs(), GNEAdditionalHandler::buildMultiLaneDetectorE2(), GNEAdditionalHandler::buildOverheadWire(), GNEAdditionalHandler::buildParkingArea(), GNEAdditionalHandler::buildParkingSpace(), GNERouteHandler::buildPersonStop(), GNERouteHandler::buildPersonTrip(), GNEAdditionalHandler::buildPOIGeo(), GNEAdditionalHandler::buildRerouterInterval(), GNERouteHandler::buildRide(), GNEAdditionalHandler::buildSingleLaneDetectorE2(), GNERouteHandler::buildStop(), GNEAdditionalHandler::buildTAZ(), GNEDataHandler::buildTAZRelationData(), GNERouteHandler::buildTranship(), GNERouteHandler::buildTransport(), GNERouteHandler::buildTrip(), GNERouteHandler::buildTripJunctions(), GNERouteHandler::buildTripTAZs(), GNEAdditionalHandler::buildVaporizer(), GNERouteHandler::buildVehicleOverRoute(), GNERouteHandler::buildWalk(), AdditionalHandler::checkCalibratorFlowParents(), AdditionalHandler::checkDetectPersons(), checkFileName(), checkListOfVehicleTypes(), checkNegative(), checkNegative(), checkNegative(), DataHandler::checkParent(), checkParsedParent(), checkValidAdditionalID(), checkValidDemandElementID(), checkValidDetectorID(), GNERouteHandler::checkViaAttribute(), GNERouteHandler::getDistributionElements(), DataHandler::myStartElement(), GNEMeanDataHandler::parseAttributes(), AdditionalHandler::parseCalibratorAttributes(), AdditionalHandler::parseCalibratorFlowAttributes(), AdditionalHandler::parseChargingStationAttributes(), AdditionalHandler::parseE2Attributes(), GNEAdditionalHandler::parseEdges(), GNERouteHandler::parseEdges(), GNEMeanDataHandler::parseEdges(), RouteHandler::parseFlow(), GNEAdditionalHandler::parseLanes(), RouteHandler::parseNestedCFM(), parseParameters(), AdditionalHandler::parsePOIAttributes(), RouteHandler::parseRoute(), RouteHandler::parseStopParameters(), RouteHandler::parseTranship(), RouteHandler::parseTrip(), RouteHandler::parseWalk(), writeErrorDuplicated(), writeErrorInvalidDistribution(), writeErrorInvalidLanes(), writeErrorInvalidParent(), writeErrorInvalidParent(), writeErrorInvalidParent(), and writeErrorInvalidPosition().
|
protected |
write error "duplicated additional"
Definition at line 235 of file CommonHandler.cpp.
References TLF, toString(), and writeError().
Referenced by GNEAdditionalHandler::checkDuplicatedAdditional(), GNEDataHandler::checkDuplicatedDataSet(), GNERouteHandler::checkDuplicatedDemandElement(), and GNEMeanDataHandler::checkDuplicatedMeanDataElement().
|
protected |
write error "invalid distribution"
Definition at line 247 of file CommonHandler.cpp.
References TLF, toString(), and writeError().
Referenced by RouteHandler::parseRouteDistribution(), and RouteHandler::parseVTypeDistribution().
|
protected |
write error "invalid list of lanes"
Definition at line 241 of file CommonHandler.cpp.
References TLF, toString(), and writeError().
|
protected |
write error "invalid parent element" giving ids of current and parent element
Definition at line 253 of file CommonHandler.cpp.
References TLF, toString(), and writeError().
Referenced by GNEAdditionalHandler::buildAccess(), GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildCalibratorFlow(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildClosingLaneReroute(), GNEAdditionalHandler::buildClosingReroute(), GNERouteHandler::buildContainerStop(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDestProbReroute(), GNEAdditionalHandler::buildDetectorE1Instant(), GNEAdditionalHandler::buildDetectorEntry(), GNEAdditionalHandler::buildDetectorExit(), GNEAdditionalHandler::buildE1Detector(), GNEAdditionalHandler::buildEdgeCalibrator(), GNEDataHandler::buildEdgeData(), GNEDataHandler::buildEdgeRelationData(), GNERouteHandler::buildEmbeddedRoute(), GNERouteHandler::buildFlow(), GNERouteHandler::buildFlowJunctions(), GNERouteHandler::buildFlowOverRoute(), GNERouteHandler::buildFlowTAZs(), GNEAdditionalHandler::buildLaneCalibrator(), GNEAdditionalHandler::buildOverheadWire(), GNEAdditionalHandler::buildParkingArea(), GNEAdditionalHandler::buildParkingAreaReroute(), GNEAdditionalHandler::buildParkingSpace(), GNERouteHandler::buildPerson(), GNERouteHandler::buildPersonFlow(), GNERouteHandler::buildPersonStop(), GNERouteHandler::buildPersonTrip(), GNEAdditionalHandler::buildPOILane(), GNEAdditionalHandler::buildRerouterInterval(), GNERouteHandler::buildRide(), GNEAdditionalHandler::buildRouteProbe(), GNEAdditionalHandler::buildRouteProbReroute(), GNEAdditionalHandler::buildSingleLaneDetectorE2(), GNERouteHandler::buildStop(), GNEDataHandler::buildTAZRelationData(), GNEAdditionalHandler::buildTAZSink(), GNEAdditionalHandler::buildTAZSource(), GNEAdditionalHandler::buildTrainStop(), GNERouteHandler::buildTranship(), GNERouteHandler::buildTransport(), GNERouteHandler::buildTrip(), GNERouteHandler::buildTripJunctions(), GNERouteHandler::buildTripTAZs(), GNEAdditionalHandler::buildVaporizer(), GNEAdditionalHandler::buildVariableSpeedSignStep(), GNERouteHandler::buildVehicleOverRoute(), GNERouteHandler::buildWalk(), GNERouteHandler::parseEdge(), GNERouteHandler::parseJunction(), and GNERouteHandler::parseTAZ().
|
protected |
write error "invalid parent element" without giving IDs
Definition at line 265 of file CommonHandler.cpp.
References TLF, toString(), and writeError().
|
protected |
write error "invalid parent element" giving only the id of parent element
Definition at line 259 of file CommonHandler.cpp.
References TLF, toString(), and writeError().
|
protected |
write error "invalid position"
Definition at line 229 of file CommonHandler.cpp.
References TLF, toString(), and writeError().
Referenced by GNEAdditionalHandler::buildAccess(), GNEAdditionalHandler::buildBusStop(), GNEAdditionalHandler::buildChargingStation(), GNEAdditionalHandler::buildContainerStop(), GNEAdditionalHandler::buildDetectorE1Instant(), GNEAdditionalHandler::buildDetectorEntry(), GNEAdditionalHandler::buildDetectorExit(), GNEAdditionalHandler::buildE1Detector(), GNEAdditionalHandler::buildEdgeCalibrator(), GNEAdditionalHandler::buildLaneCalibrator(), GNEAdditionalHandler::buildMultiLaneDetectorE2(), GNEAdditionalHandler::buildOverheadWire(), GNEAdditionalHandler::buildParkingArea(), GNEAdditionalHandler::buildPOILane(), GNEAdditionalHandler::buildSingleLaneDetectorE2(), and GNEAdditionalHandler::buildTrainStop().
|
protected |
common XML Structure
Definition at line 51 of file CommonHandler.h.
Referenced by AdditionalHandler::beginParseAttributes(), MeanDataHandler::beginParseAttributes(), RouteHandler::beginParseAttributes(), AdditionalHandler::checkCalibratorFlowParents(), DataHandler::checkParent(), checkParsedParent(), AdditionalHandler::endParseAttributes(), MeanDataHandler::endParseAttributes(), RouteHandler::endParseAttributes(), DataHandler::getAttributes(), RouteHandler::isEmbeddedRoute(), DataHandler::myEndElement(), DataHandler::myStartElement(), AdditionalHandler::parseAccessAttributes(), AdditionalHandler::parseBusStopAttributes(), AdditionalHandler::parseCalibratorAttributes(), AdditionalHandler::parseCalibratorFlowAttributes(), AdditionalHandler::parseChargingStationAttributes(), AdditionalHandler::parseClosingLaneRerouteAttributes(), AdditionalHandler::parseClosingRerouteAttributes(), RouteHandler::parseContainer(), RouteHandler::parseContainerFlow(), AdditionalHandler::parseContainerStopAttributes(), AdditionalHandler::parseDestProbRerouteAttributes(), AdditionalHandler::parseE1Attributes(), AdditionalHandler::parseE1InstantAttributes(), AdditionalHandler::parseE2Attributes(), AdditionalHandler::parseE3Attributes(), DataHandler::parseEdgeData(), MeanDataHandler::parseEdgeMeanData(), DataHandler::parseEdgeRelationData(), AdditionalHandler::parseEntryAttributes(), AdditionalHandler::parseExitAttributes(), RouteHandler::parseFlow(), DataHandler::parseInterval(), AdditionalHandler::parseJpsObstacleAttributes(), AdditionalHandler::parseJpsWalkableAreaAttributes(), MeanDataHandler::parseLaneMeanData(), AdditionalHandler::parseOverheadWire(), AdditionalHandler::parseOverheadWireClamp(), parseParameters(), AdditionalHandler::parseParkingAreaAttributes(), AdditionalHandler::parseParkingAreaRerouteAttributes(), AdditionalHandler::parseParkingSpaceAttributes(), RouteHandler::parsePerson(), RouteHandler::parsePersonFlow(), RouteHandler::parsePersonTrip(), AdditionalHandler::parsePOIAttributes(), AdditionalHandler::parsePolyAttributes(), AdditionalHandler::parseRerouterAttributes(), AdditionalHandler::parseRerouterIntervalAttributes(), RouteHandler::parseRide(), RouteHandler::parseRoute(), RouteHandler::parseRouteDistribution(), AdditionalHandler::parseRouteProbeAttributes(), AdditionalHandler::parseRouteProbRerouteAttributes(), RouteHandler::parseStop(), AdditionalHandler::parseTAZAttributes(), DataHandler::parseTAZRelationData(), AdditionalHandler::parseTAZSinkAttributes(), AdditionalHandler::parseTAZSourceAttributes(), AdditionalHandler::parseTractionSubstation(), AdditionalHandler::parseTrainStopAttributes(), RouteHandler::parseTranship(), RouteHandler::parseTransport(), RouteHandler::parseTrip(), AdditionalHandler::parseVaporizerAttributes(), AdditionalHandler::parseVariableSpeedSignAttributes(), AdditionalHandler::parseVariableSpeedSignStepAttributes(), RouteHandler::parseVehicle(), RouteHandler::parseVType(), RouteHandler::parseVTypeDistribution(), and RouteHandler::parseWalk().
|
protected |
flag for mark if a element wasn't created
Definition at line 54 of file CommonHandler.h.
Referenced by isErrorCreatingElement(), and writeError().