47 myObjectType(objectType) {}
62 bool& ok,
bool report)
const {
64 bool isPresent =
true;
65 const std::string& val =
getString(attr, &isPresent);
92 bool isPresent =
true;
93 const std::string& val =
getString(attr, &isPresent);
98 const std::string& valFreq =
getString(attr, &isPresent);
125 bool& ok,
SUMOTime defaultValue,
bool report)
const {
127 bool isPresent =
true;
128 const std::string& val =
getString(attr, &isPresent);
149 bool& ok,
SUMOTime defaultValue,
bool report)
const {
151 bool isPresent =
true;
152 const std::string& val =
getString(attr, &isPresent);
156 if (val ==
"begin") {
179 bool isPresent =
true;
180 const std::string& val =
getString(attr, &isPresent);
185 const std::string& valFreq =
getString(attr, &isPresent);
208 std::ostringstream oss;
209 oss <<
"Attribute '" << attrname <<
"' is missing in definition of ";
210 if (objectid ==
nullptr || objectid[0] == 0) {
222 std::ostringstream oss;
223 oss <<
"Attribute '" << attrname <<
"' in definition of ";
224 if (objectid ==
nullptr || objectid[0] == 0) {
236 std::ostringstream oss;
237 oss <<
"Attribute '" << attrname <<
"' in definition of ";
238 if (objectid ==
nullptr || objectid[0] == 0) {
243 oss <<
" " << type <<
".";
292 if ((pos.
size() != 2) && (pos.
size() != 3)) {
299 if (pos.
size() == 2) {
319 if (pos.
size() != 2 && pos.
size() != 3) {
324 if (pos.
size() == 2) {
339 if (st.
size() != 4) {
346 return Boundary(xmin, ymin, xmax, ymax);
429 std::vector<int> ret;
430 for (
const std::string& s : tmp) {
444 std::vector<double> ret;
445 for (
const std::string& s : tmp) {
456 WRITE_ERROR(
TL(
"Simultaneous specification of vClasses and exceptions is not allowed"));
464 const std::string vClasses = getOpt<std::string>(
SUMO_ATTR_VCLASSES,
nullptr, ok,
"");
471 permissions = ~parseVehicleClasses(exceptions);
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
ParkingType
Numbers representing special SUMO-XML-attribute values Information on whether a car is parking on the...
RoundaboutType
classifying roundabout type for nodes
FringeType
classifying boundary nodes
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
RightOfWay
algorithms for computing right of way
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
A point in 2D or 3D with translation and scaling methods.
static RGBColor parseColor(std::string coldef)
Parses a color information.
virtual std::string getString(int id, bool *isPresent=nullptr) const =0
Returns the string-value of the named (by its enum-value) attribute.
SUMOTime getOptPeriod(const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read the SUMOTime 'period' attribute.
T fromString(const std::string &value) const
SUMOSAXAttributes(const std::string &objectType)
SUMOTime getOptOffsetReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a tls offset (SUMOTime or "begin")
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.
StopOffset getStopOffset(bool &ok) const
Parses a stop offset definition (vClasses/exceptions and value) from the attributes.
void emitFormatError(const std::string &attrname, const std::string &type, const char *objectid) const
virtual std::string getName(int attr) const =0
Converts the given attribute id into a man readable string.
void emitEmptyError(const std::string &attrname, const char *objectid) const
std::string myObjectType
the object type to use in error reporting
static const std::string ENCODING
The encoding of parsed strings.
void emitUngivenError(const std::string &attrname, const char *objectid) const
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
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.
static StringBijection< SumoXMLNodeType > NodeTypes
node types
static StringBijection< SumoXMLEdgeFunc > EdgeFunctions
edge functions
static StringBijection< RightOfWay > RightOfWayValues
righ of way algorithms
static StringBijection< RoundaboutType > RoundaboutTypeValues
fringe types
static StringBijection< FringeType > FringeTypeValues
fringe types
T get(const std::string &str) const
get key
int size() const
returns the number of existing substrings
std::vector< std::string > getVector()
return vector of strings
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
static long long int toLong(const std::string &sData)
converts a string into the long value described by it by calling the char-type converter,...
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter