43 #ifdef CHECK_MEMORY_LEAKS
45 #endif // CHECK_MEMORY_LEAKS
59 myObjectType(objectType) {}
64 bool& ok,
bool report)
const {
65 #ifdef HAVE_SUBSECOND_TIMESTEPS
87 return get<int>(attr, objectid, ok, report);
94 bool& ok,
SUMOTime defaultValue,
bool report)
const {
95 #ifdef HAVE_SUBSECOND_TIMESTEPS
113 return getOpt<int>(attr, objectid, ok, defaultValue, report);
123 std::ostringstream oss;
124 oss <<
"Attribute '" << attrname <<
"' is missing in definition of ";
125 if (objectid == 0 || objectid[0] == 0) {
137 std::ostringstream oss;
138 oss <<
"Attribute '" << attrname <<
"' in definition of ";
139 if (objectid == 0 || objectid[0] == 0) {
151 std::ostringstream oss;
152 oss <<
"Attribute '" << attrname <<
"' in definition of ";
153 if (objectid == 0 || objectid[0] == 0) {
158 oss <<
" is not " << type <<
".";
165 if (def.find(
';') != std::string::npos || def.find(
',') != std::string::npos) {
167 WRITE_WARNING(
"Please note that using ';' and ',' as XML list separators is deprecated.\n From 1.0 onwards, only ' ' will be accepted.");
173 into.push_back(st.
next());
180 if (def.find(
';') != std::string::npos || def.find(
',') != std::string::npos) {
182 WRITE_WARNING(
"Please note that using ';' and ',' as XML list separators is deprecated.\n From 1.0 onwards, only ' ' will be accepted.");
188 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
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...
A class that stores a 2D geometrical boundary.
#define WRITE_WARNING(msg)
virtual std::string getString(int id) const =0
Returns the string-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
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
virtual SUMOLong getLong(int id) const =0
Returns the long-value of the named (by its enum-value) attribute.
virtual SUMOReal getFloat(int id) const =0
Returns the SUMOReal-value of the named (by its enum-value) attribute.
static const std::string ENCODING
The encoding of parsed strings.
virtual Boundary getBoundary(int attr) const =0
Tries to read given attribute assuming it is a Boundary.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
static bool myHaveInformedAboutDeprecatedDivider
Information whether the usage of a deprecated divider was reported.
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.
void emitEmptyError(const std::string &attrname, const char *objectid) const
void emitFormatError(const std::string &attrname, const std::string &type, const char *objectid) const