![]() |
SUMO - Simulation of Urban MObility
|
#include <TplConvert.h>
Static Public Member Functions | |
template<class E > | |
static int | getLength (const E *const data) |
returns the length of the string (the position of the 0-character) More... | |
Conversion of basic types and data arrays to String | |
static std::string | _2str (const int var) |
convert int to string More... | |
static std::string | _2str (const SUMOReal var) |
convert SUMOReal to string More... | |
static std::string | _2str (const bool var) |
convert bool to string More... | |
template<class E > | |
static std::string | _2str (const E *const data) |
converts a 0-terminated char-type array into std::string More... | |
static std::string | _2str (const char *const data) |
converts a 0-terminated char array into std::string More... | |
template<class E > | |
static std::string | _2str (const E *const data, int length) |
converts a char-type array into std::string considering the given length More... | |
*static std::string | _2str (const char *const data, int length) |
converts a char array into std::string considering the given length More... | |
template<class E > | |
static std::string | _2strSec (const E *const data, const std::string &def) |
converts a 0-terminated char-type array into std::string More... | |
template<class E > | |
static std::string | _2strSec (const E *const data, int length, const std::string &def) |
converts a char-type array into std::string considering the given length More... | |
Conversion to basic type int | |
template<class E > | |
static int | _2int (const E *const data) |
converts a char-type array into the integer value described by it More... | |
static int | _str2int (const std::string &sData) |
converts a string into the integer value described by it by calling the char-type converter, which More... | |
template<class E > | |
static int | _hex2int (const E *const data) |
converts a char-type array with a hex value into the integer value described by it More... | |
static int | _strHex2int (const std::string &sData) |
converts a string with a hex value into the integer value described by it by calling the char-type converter More... | |
template<class E > | |
static int | _2intSec (const E *const data, int def) |
converts a 0-terminated char-type array into the integer value described by it More... | |
Conversion to basic type long | |
template<class E > | |
static long long int | _2long (const E *const data) |
converts a char-type array into the long value described by it More... | |
template<class E > | |
static long long int | _hex2long (const E *const data) |
converts a char-type array with a hex value into the long value described by it More... | |
template<class E > | |
static long long int | _2longSec (const E *const data, long def) |
converts a 0-terminated char-type array into the long value described by it More... | |
Conversion to basic type SUMOReal (Double) | |
template<class E > | |
static SUMOReal | _2SUMOReal (const E *const data) |
converts a char-type array into the SUMOReal value described by it More... | |
static SUMOReal | _str2SUMOReal (const std::string &sData) |
converts a string into the SUMOReal value described by it by calling the char-type converter More... | |
template<class E > | |
static SUMOReal | _2SUMORealSec (const E *const data, SUMOReal def) |
converts a 0-terminated char-type array into the SUMOReal value described by it More... | |
Conversion to basic type bool | |
template<class E > | |
static bool | _2bool (const E *const data) |
converts a 0-terminated char-type array into the boolean value described by it More... | |
static bool | _str2Bool (const std::string &sData) |
converts a string into the bool value described by it by calling the char-type converter More... | |
template<class E > | |
*static bool | _2boolSec (const E *const data, bool def) |
converts a 0-terminated char-type array into the SUMOReal value described by it More... | |
TplConvert Some methods that convert 0-terminated char-arrays of any type into other values (numerical/boolean) or into std::strings Also convert strings into any type of values (SUMOReal, int, bool...)
Definition at line 52 of file TplConvert.h.
|
inlinestatic |
converts a 0-terminated char-type array into the boolean value described by it
an | EmptyData - exception if the given string is empty or 0 pointer |
a | BoolFormatException in any other case |
Definition at line 364 of file TplConvert.h.
References _2str().
Referenced by _2boolSec(), _str2Bool(), MSDevice::equippedByDefaultAssignmentOptions(), SUMOSAXAttributesImpl_Xerces::getBool(), NIImporter_VISUM::getWeightedBool(), MSSOTLTrafficLightLogic::isDecayThresholdActivated(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), GUISettingsHandler::myStartElement(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_TrafficLights(), GUISettingsHandler::parseSizeSettings(), GUISettingsHandler::parseTextSettings(), and Option_Bool::set().
|
inlinestatic |
converts a 0-terminated char-type array into the SUMOReal value described by it
Definition at line 391 of file TplConvert.h.
References _2bool().
|
inlinestatic |
converts a char-type array into the integer value described by it
an | EmptyData - exception if the given string is empty |
a | NumberFormatException - exception when the string does not contain an integer |
Definition at line 149 of file TplConvert.h.
References _2long(), max, and min.
Referenced by _2intSec(), _2SUMOReal(), _str2int(), NIXMLEdgesHandler::addSplit(), MFXAddEditTypedTable::getControlForItem(), OutputDevice::getDevice(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), SUMOSAXAttributesImpl_Xerces::getInt(), NINavTeqHelper::getLaneNumber(), MSSwarmTrafficLightLogic::getMaxCongestionDuration(), MSSOTLRequestPolicy::getMinDecisionalPhaseDuration(), MSSOTLRequestTrafficLightLogic::getMinDecisionalPhaseDuration(), MSSOTLTrafficLightLogic::getMode(), MSSwarmTrafficLightLogic::getReinforcementMode(), NINavTeqHelper::getSpeed(), MSSOTLTrafficLightLogic::getThreshold(), MSSwarmTrafficLightLogic::init(), NIImporter_SUMO::interpretLaneID(), PCLoaderVisum::load(), NIImporter_ITSUMO::Handler::myEndElement(), GUISettingsHandler::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), GNEVariableSpeedSignalDialog::onCmdRemoveRow(), NIVissimSingleTypeParser_Streckendefinition::parse(), NIVissimSingleTypeParser_VWunschentscheidungsdefinition::parse(), NIVissimSingleTypeParser_Kantensperrung::parse(), NIVissimSingleTypeParser_Knotendefinition::parse(), NIVissimSingleTypeParser_Verbindungsdefinition::parse(), NIVissimSingleTypeParser_Fahrzeugklassendefinition::parse(), NIVissimSingleTypeParser_Fahrzeugtypdefinition::parse(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Types(), SUMOVehicleParameter::parseArrivalLane(), NIImporter_Vissim::VissimSingleTypeParser::parseAssignedVehicleTypes(), RGBColor::parseColor(), SUMOVehicleParameter::parseDepartLane(), NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition::parsePos(), ODMatrix::parseSingleTime(), NIImporter_Vissim::VissimSingleTypeParser::readExtEdgePointDef(), ODMatrix::readO(), ODMatrix::readV(), NIImporter_DlrNavteq::EdgesHandler::report(), Option_Integer::set(), Option_IntVector::set(), MSSOTLE2Sensors::setVehicleWeigths(), GNENet::splitEdge(), and RODFDetector::writeEmitterDefinition().
|
inlinestatic |
converts a 0-terminated char-type array into the integer value described by it
Definition at line 186 of file TplConvert.h.
References _2int().
Referenced by GNEApplicationWindow::GNEShapeHandler::getLanePos(), RODFDetectorHandler::myStartElement(), NIImporter_VISUM::parse_Edges(), and NIXMLConnectionsHandler::parseDeprecatedLaneDefinition().
|
inlinestatic |
converts a char-type array into the long value described by it
an | EmptyData - exception if the given string is empty |
a | NumberFormatException - exception when the string does not contain a long |
Definition at line 200 of file TplConvert.h.
Referenced by _2int(), _2longSec(), SUMOSAXAttributesImpl_Xerces::getLong(), PCLoaderVisum::load(), MSStateHandler::myStartElement(), NIImporter_VISUM::parse_AreaSubPartElement(), NIImporter_VISUM::parse_Districts(), NIImporter_VISUM::parse_Kante(), NIImporter_VISUM::parse_PartOfArea(), and NIImporter_VISUM::parse_Point().
|
inlinestatic |
converts a 0-terminated char-type array into the long value described by it
Definition at line 276 of file TplConvert.h.
References _2long().
|
inlinestatic |
convert int to string
Definition at line 57 of file TplConvert.h.
Referenced by _2bool(), _2str(), _2strSec(), OptionsLoader::characters(), GenericSAXHandler::characters(), GenericSAXHandler::endElement(), OptionsLoader::error(), OptionsLoader::fatalError(), OptionsIO::getRoot(), SUMOSAXAttributesImpl_Xerces::getString(), XMLSubSys::init(), OptionsIO::loadConfiguration(), NILoader::loadXMLType(), main(), MSChargingStation::MSChargingStation(), MSDevice_Battery::MSDevice_Battery(), SUMOSAXReader::LocalSchemaResolver::resolveEntity(), SUMOSAXAttributesImpl_Xerces::serialize(), MSDevice_Battery::setAirDragCoefficient(), MSChargingStation::setChargeDelay(), MSChargingStation::setChargingPower(), MSDevice_Battery::setConstantPowerIntake(), MSChargingStation::setEfficency(), MSDevice_Battery::setFrontSurfaceArea(), MSDevice_Battery::setInternalMomentOfInertia(), MSDevice_Battery::setMass(), MSDevice_Battery::setMaximumBatteryCapacity(), MSDevice_Battery::setPowerMax(), MSDevice_Battery::setPropulsionEfficiency(), MSDevice_Battery::setRadialDragCoefficient(), MSDevice_Battery::setRecuperationEfficiency(), MSDevice_Battery::setRollDragCoefficient(), OptionsLoader::startElement(), GenericSAXHandler::startElement(), and OptionsLoader::warning().
|
inlinestatic |
convert SUMOReal to string
Definition at line 64 of file TplConvert.h.
|
inlinestatic |
convert bool to string
Definition at line 71 of file TplConvert.h.
|
inlinestatic |
converts a 0-terminated char-type array into std::string
an | EmptyData - exception if the given pointer is 0 |
Definition at line 78 of file TplConvert.h.
References _2str(), and getLength().
|
inlinestatic |
converts a 0-terminated char array into std::string
an | EmptyData - exception if the given pointer is 0 |
Definition at line 84 of file TplConvert.h.
|
inlinestatic |
converts a char-type array into std::string considering the given length
an | EmptyData - exception if the given pointer is 0 |
Definition at line 94 of file TplConvert.h.
|
inlinestatic |
converts a char array into std::string considering the given length
an | EmptyData - exception if the given pointer is 0 |
Definition at line 118 of file TplConvert.h.
|
inlinestatic |
converts a 0-terminated char-type array into std::string
Definition at line 128 of file TplConvert.h.
References getLength().
Referenced by SUMOSAXAttributesImpl_Xerces::getStringSecure().
|
inlinestatic |
converts a char-type array into std::string considering the given length
Definition at line 135 of file TplConvert.h.
References _2str().
|
inlinestatic |
converts a char-type array into the SUMOReal value described by it
an | EmptyData - exception if the given string is empty |
a | NumberFormatException - exception when the string does not contain a SUMOReal |
Definition at line 290 of file TplConvert.h.
References _2int(), and SUMOReal.
Referenced by _2SUMORealSec(), _str2SUMOReal(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), NBEdgeCont::applyOptions(), MSDevice_Battery::buildVehicleDevices(), MSDevice_Example::buildVehicleDevices(), MSSwarmTrafficLightLogic::getBetaNo(), MSSwarmTrafficLightLogic::getBetaSp(), SUMOSAXAttributesImpl_Xerces::getBoundary(), MSSwarmTrafficLightLogic::getChangePlanProbability(), MFXAddEditTypedTable::getControlForItem(), MSSOTLTrafficLightLogic::getDecayConstant(), SUMOSAXAttributesImpl_Xerces::getFloat(), SUMOSAXAttributesImpl_Binary::getFloat(), MSSwarmTrafficLightLogic::getForgettingCox(), MSSwarmTrafficLightLogic::getGammaNo(), MSSwarmTrafficLightLogic::getGammaSp(), MSSOTLTrafficLightLogic::getInputSensorsLength(), MSSwarmTrafficLightLogic::getLearningCox(), NIImporter_VISUM::getNamedFloat(), MSSOTLTrafficLightLogic::getOutputSensorsLength(), MSSwarmTrafficLightLogic::getPheroMaxVal(), SUMOSAXAttributesImpl_Xerces::getShape(), MSSOTLTrafficLightLogic::getSpeedThreshold(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), MSSwarmTrafficLightLogic::getThetaInit(), MSSwarmTrafficLightLogic::getThetaMax(), MSSwarmTrafficLightLogic::getThetaMin(), getTurningDefaults(), NIImporter_VISUM::getWeightedFloat(), PushButtonLogic::init(), SigmoidLogic::init(), MSSwarmTrafficLightLogic::init(), PCLoaderVisum::load(), PCLoaderDlrNavteq::loadPolyFile(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSSOTLPolicy::MSSOTLPolicy(), NIImporter_ITSUMO::Handler::myEndElement(), GUISettingsHandler::myStartElement(), NIImporter_OpenStreetMap::NodesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), GUIDialog_ViewSettings::onCmdEditTable(), NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition::parse(), NIVissimSingleTypeParser_Laengenverteilungsdefinition::parse(), NIVissimSingleTypeParser_Simdauer::parse(), NIVissimSingleTypeParser_Streckendefinition::parse(), NIVissimSingleTypeParser_Zeitenverteilungsdefinition::parse(), NIVissimSingleTypeParser_Verbindungsdefinition::parse(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_Point(), SUMOVehicleParameter::parseArrivalPos(), SUMOVehicleParameter::parseArrivalSpeed(), GeomConvHelper::parseBoundaryReporting(), RGBColor::parseColor(), SUMOVehicleParameter::parseDepartPos(), SUMOVehicleParameter::parseDepartPosLat(), SUMOVehicleParameter::parseDepartSpeed(), GeomConvHelper::parseShapeReporting(), GUISettingsHandler::parseSizeSettings(), GUISettingsHandler::parseTextSettings(), ODMatrix::parseTimeLine(), RODFDetFlowLoader::read(), ODMatrix::readFactor(), ODMatrix::readO(), ODMatrix::readV(), NIImporter_DlrNavteq::EdgesHandler::report(), Option_Float::set(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), and RODFDetector::writeEmitterDefinition().
|
inlinestatic |
converts a 0-terminated char-type array into the SUMOReal value described by it
Definition at line 348 of file TplConvert.h.
References _2SUMOReal().
Referenced by MSRouteHandler::openRouteDistribution(), NIImporter_VISUM::parse_Edges(), and MSSOTLPolicyDesirability::readParameter().
|
inlinestatic |
converts a char-type array with a hex value into the integer value described by it
an | EmptyData - exception if the given string is empty |
a | NumberFormatException - exception when the string does not contain an integer |
Definition at line 168 of file TplConvert.h.
References _hex2long(), max, and min.
Referenced by _strHex2int(), and RGBColor::parseColor().
|
inlinestatic |
converts a char-type array with a hex value into the long value described by it
an | EmptyData - exception if the given string is empty |
a | NumberFormatException - exception when the string does not contain a long |
Definition at line 233 of file TplConvert.h.
Referenced by _hex2int().
|
inlinestatic |
converts a string into the bool value described by it by calling the char-type converter
an | EmptyData - exception if the given string is empty |
a | NumberFormatException - exception when the string does not contain a bool |
Definition at line 382 of file TplConvert.h.
References _2bool().
Referenced by GNEAttributeCarrier::getDefaultValue(), and GNEAttributeCarrier::parse().
|
inlinestatic |
converts a string into the integer value described by it by calling the char-type converter, which
an | EmptyData - exception if the given string is empty |
NumberFormatException | - exception when the string does not contain an integer |
Definition at line 160 of file TplConvert.h.
References _2int().
Referenced by GNEAttributeCarrier::getDefaultValue(), NBNodeCont::mapToNumericalIDs(), NBEdgeCont::mapToNumericalIDs(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), NIImporter_Vissim::NIVissimXMLHandler_Fahrzeugklassendefinition::myEndElement(), GNECalibratorDialog::onCmdAddRow(), GNEVariableSpeedSignalDialog::onCmdAddRow(), GNEAttributeCarrier::parse(), and NIVissimConflictArea::setPriorityRegulation().
|
inlinestatic |
converts a string into the SUMOReal value described by it by calling the char-type converter
an | EmptyData - exception if the given string is empty |
a | NumberFormatException - exception when the string does not contain a SUMOReal |
Definition at line 341 of file TplConvert.h.
References _2SUMOReal().
Referenced by GNEAttributeCarrier::getDefaultValue(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), NIImporter_Vissim::NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition::myEndElement(), GNECalibratorDialog::onCmdAddRow(), GNEVariableSpeedSignalDialog::onCmdAddRow(), and GNEAttributeCarrier::parse().
|
inlinestatic |
converts a string with a hex value into the integer value described by it by calling the char-type converter
an | EmptyData - exception if the given string is empty |
a | NumberFormatException - exception when the string does not contain an integer |
Definition at line 179 of file TplConvert.h.
References _hex2int().
Referenced by NIImporter_Vissim::NIVissimXMLHandler_Fahrzeugklassendefinition::myEndElement().
|
inlinestatic |
returns the length of the string (the position of the 0-character)
Definition at line 401 of file TplConvert.h.
Referenced by _2str(), and _2strSec().