80 T
get(
int attr,
const char* objectid,
bool& ok,
bool report =
true)
const;
99 T
getOpt(
int attr,
const char* objectid,
bool& ok, T defaultValue,
bool report =
true)
const;
119 bool report =
true)
const;
142 SUMOTime defaultValue,
bool report =
true)
const;
215 virtual long long int getLong(
int id)
const = 0;
246 const std::string& def)
const = 0;
282 virtual double getFloat(
const std::string&
id)
const = 0;
295 const std::string& def)
const = 0;
357 const std::vector<std::string>
getOptStringVector(
int attr,
const char* objectid,
bool& ok,
bool report =
true)
const;
370 const std::vector<int>
getOptIntVector(
int attr,
const char* objectid,
bool& ok,
bool report =
true)
const;
379 virtual std::string
getName(
int attr)
const = 0;
410 void emitUngivenError(
const std::string& attrname,
const char* objectid)
const;
411 void emitEmptyError(
const std::string& attrname,
const char* objectid)
const;
412 void emitFormatError(
const std::string& attrname,
const std::string& type,
const char* objectid)
const;
479 static const std::vector<std::string>
value;
484 static const std::vector<int>
value;
489 template <
typename T>
491 bool& ok,
bool report)
const {
500 return getInternal<T>(attr);
515 template <
typename T>
517 bool& ok, T defaultValue,
bool report)
const {
522 return getInternal<T>(attr);
std::ostream & operator<<(std::ostream &os, const SUMOSAXAttributes &src)
FringeType
algorithms for computing right of way
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
A class that stores a 2D geometrical boundary.
Encapsulated SAX-Attributes.
virtual bool getBool(int id) const =0
Returns the bool-value of the named (by its enum-value) attribute.
virtual int getInt(int id) const =0
Returns the int-value of the named (by its enum-value) attribute.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual RGBColor getColor() const =0
Returns the value of the named attribute.
virtual std::string getStringSecure(const std::string &id, const std::string &def) const =0
Returns the string-value of the named (by its enum-value) attribute.
virtual PositionVector getShape(int attr) const =0
Tries to read given attribute assuming it is a PositionVector.
virtual void serialize(std::ostream &os) const =0
Prints all attribute names and values into the given stream.
virtual std::vector< std::string > getAttributeNames() const =0
Retrieves all attribute names.
virtual SUMOSAXAttributes * clone() const =0
return a new deep-copy attributes object
const std::vector< std::string > getOptStringVector(int attr, const char *objectid, bool &ok, bool report=true) const
convenience function to avoid the default argument and the template stuff at getOpt<>
virtual ~SUMOSAXAttributes()
Destructor.
SUMOSAXAttributes(const std::string &objectType)
const std::vector< std::string > getStringVector(int attr) const
Tries to read given attribute assuming it is a string vector.
SUMOSAXAttributes & operator=(const SUMOSAXAttributes &src)
Invalidated assignment operator.
const std::string & getObjectType() const
return the objecttype to which these attributes belong
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.
virtual std::string getStringSecure(int id, const std::string &def) const =0
Returns the string-value of the named (by its enum-value) attribute.
virtual FringeType getFringeType(bool &ok) const =0
returns fringe type
virtual RightOfWay getRightOfWay(bool &ok) const =0
Returns the right-of-way method.
SUMOSAXAttributes(const SUMOSAXAttributes &src)
Invalidated copy constructor.
T getInternal(const int attr) const
const std::vector< int > getIntVector(int attr) const
Tries to read given attribute assuming it is an int vector.
friend std::ostream & operator<<(std::ostream &os, const SUMOSAXAttributes &src)
virtual double getFloat(const std::string &id) const =0
Returns the double-value of the named attribute.
void emitFormatError(const std::string &attrname, const std::string &type, const char *objectid) const
virtual double getFloat(int id) const =0
Returns the double-value of the named (by its enum-value) attribute.
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.
virtual Boundary getBoundary(int attr) const =0
Tries to read given attribute assuming it is a Boundary.
virtual long long int getLong(int id) const =0
Returns the long-value of the named (by its enum-value) attribute.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
const std::vector< int > getOptIntVector(int attr, const char *objectid, bool &ok, bool report=true) const
convenience function to avoid the default argument and the template stuff at getOpt<>
void emitUngivenError(const std::string &attrname, const char *objectid) const
virtual SumoXMLNodeType getNodeType(bool &ok) const =0
Returns the value of the named attribute.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
virtual bool hasAttribute(const std::string &id) const =0
Returns the information whether the named attribute is within the current list.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
virtual SumoXMLEdgeFunc getEdgeFunc(bool &ok) const =0
Returns the value of the named attribute.
static const std::string type
static const Boundary value
static const std::string type
static const PositionVector value
static const std::string type
static const RGBColor value
static const std::string type
static const double value
static const std::string type
static const std::string type
static const std::string type
static const long long int value
static const std::string value
static const std::string type
static const std::string type
static const std::vector< int > value
static const std::string type
static const std::vector< std::string > value
static const std::string type