47 myObjectType(objectType) {}
64 bool& ok,
bool report)
const {
73 const std::string val = getInternal<std::string>(attr);
91 bool& ok,
SUMOTime defaultValue,
bool report)
const {
96 const std::string val = getInternal<std::string>(attr);
114 std::ostringstream oss;
115 oss <<
"Attribute '" << attrname <<
"' is missing in definition of ";
116 if (objectid ==
nullptr || objectid[0] == 0) {
128 std::ostringstream oss;
129 oss <<
"Attribute '" << attrname <<
"' in definition of ";
130 if (objectid ==
nullptr || objectid[0] == 0) {
142 std::ostringstream oss;
143 oss <<
"Attribute '" << attrname <<
"' in definition of ";
144 if (objectid ==
nullptr || objectid[0] == 0) {
149 oss <<
" is not " << type <<
".";
158 into.push_back(st.
next());
167 into.insert(st.
next());
SUMOSAXAttributes(const std::string &objectType)
virtual RGBColor getColor() const =0
Returns the value of the named attribute.
static void parseStringSet(const std::string &def, std::set< std::string > &into)
Splits the given string, stores it in a set.
virtual PositionVector getShape(int attr) const =0
Tries to read given attribute assuming it is a PositionVector.
virtual std::string getName(int attr) const =0
Converts the given attribute id into a man readable string.
std::string myObjectType
the object type to use in error reporting
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
A class that stores a 2D geometrical boundary.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
virtual long long int getLong(int id) const =0
Returns the long-value of the named (by its enum-value) attribute.
void emitFormatError(const std::string &attrname, const std::string &type, const char *objectid) const
static const std::string ENCODING
The encoding of parsed strings.
SUMOTime string2time(const std::string &r)
void emitUngivenError(const std::string &attrname, const char *objectid) const
virtual Boundary getBoundary(int attr) const =0
Tries to read given attribute assuming it is a Boundary.
void emitEmptyError(const std::string &attrname, const char *objectid) const
virtual double getFloat(int id) const =0
Returns the double-value of the named (by its enum-value) 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.
T getInternal(const int attr) const
virtual int getInt(int id) const =0
Returns the int-value of the named (by its enum-value) attribute.
virtual bool getBool(int id) const =0
Returns the bool-value of the named (by its enum-value) attribute.