81 T
get(
int attr,
const char* objectid,
bool& ok,
bool report =
true)
const;
100 T
getOpt(
int attr,
const char* objectid,
bool& ok, T defaultValue,
bool report =
true)
const;
120 bool report =
true)
const;
143 SUMOTime defaultValue,
bool report =
true)
const;
216 virtual long long int getLong(
int id)
const = 0;
247 const std::string& def)
const = 0;
283 virtual double getFloat(
const std::string&
id)
const = 0;
296 const std::string& def)
const = 0;
364 const std::vector<std::string>
getOptStringVector(
int attr,
const char* objectid,
bool& ok,
bool report =
true)
const;
377 const std::vector<int>
getOptIntVector(
int attr,
const char* objectid,
bool& ok,
bool report =
true)
const;
386 virtual std::string
getName(
int attr)
const = 0;
417 void emitUngivenError(
const std::string& attrname,
const char* objectid)
const;
418 void emitEmptyError(
const std::string& attrname,
const char* objectid)
const;
419 void emitFormatError(
const std::string& attrname,
const std::string& type,
const char* objectid)
const;
491 static const std::vector<std::string>
value;
496 static const std::vector<int>
value;
501 template <
typename T>
503 bool& ok,
bool report)
const {
512 return getInternal<T>(attr);
527 template <
typename T>
529 bool& ok, T defaultValue,
bool report)
const {
534 return getInternal<T>(attr);
std::ostream & operator<<(std::ostream &os, const SUMOSAXAttributes &src)
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
A class that stores a 2D geometrical boundary.
A point in 2D or 3D with translation and scaling methods.
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 Position getPosition(int attr) const =0
Tries to read given attribute assuming it is a Position.
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
SUMOSAXAttributes & operator=(const SUMOSAXAttributes &src)=delete
Invalidated assignment operator.
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.
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)=delete
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 Position value
static const std::string type
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