46 myObjectType(objectType) {}
61 bool& ok,
bool report)
const {
63 bool isPresent =
true;
64 const std::string& val =
getString(attr, &isPresent);
91 bool isPresent =
true;
92 const std::string& val =
getString(attr, &isPresent);
97 const std::string& valFreq =
getString(attr, &isPresent);
124 bool& ok,
SUMOTime defaultValue,
bool report)
const {
126 bool isPresent =
true;
127 const std::string& val =
getString(attr, &isPresent);
150 bool isPresent =
true;
151 const std::string& val =
getString(attr, &isPresent);
156 const std::string& valFreq =
getString(attr, &isPresent);
179 std::ostringstream oss;
180 oss <<
"Attribute '" << attrname <<
"' is missing in definition of ";
181 if (objectid ==
nullptr || objectid[0] == 0) {
193 std::ostringstream oss;
194 oss <<
"Attribute '" << attrname <<
"' in definition of ";
195 if (objectid ==
nullptr || objectid[0] == 0) {
207 std::ostringstream oss;
208 oss <<
"Attribute '" << attrname <<
"' in definition of ";
209 if (objectid ==
nullptr || objectid[0] == 0) {
214 oss <<
" " << type <<
".";
263 if ((pos.
size() != 2) && (pos.
size() != 3)) {
270 if (pos.
size() == 2) {
290 if (pos.
size() != 2 && pos.
size() != 3) {
295 if (pos.
size() == 2) {
310 if (st.
size() != 4) {
317 return Boundary(xmin, ymin, xmax, ymax);
390 std::vector<int> ret;
391 for (
const std::string& s : tmp) {
405 std::vector<double> ret;
406 for (
const std::string& s : tmp) {
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
ParkingType
Numbers representing special SUMO-XML-attribute values Information on whether a car is parking on the...
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 getOptSUMOTimeReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
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
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< FringeType > FringeTypeValues
fringe types
T get(const std::string &str) const
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