 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
18 #ifndef SUMOSAXAttributes_h
19 #define SUMOSAXAttributes_h
82 T
get(
int attr,
const char* objectid,
bool& ok,
bool report =
true)
const;
100 template <
typename T>
101 T
getOpt(
int attr,
const char* objectid,
bool& ok, T defaultValue,
bool report =
true)
const;
121 bool report =
true)
const;
144 SUMOTime defaultValue,
bool report =
true)
const;
217 virtual long long int getLong(
int id)
const = 0;
248 const std::string& def)
const = 0;
284 virtual double getFloat(
const std::string&
id)
const = 0;
297 const std::string& def)
const = 0;
359 const std::vector<std::string>
getOptStringVector(
int attr,
const char* objectid,
bool& ok,
bool report =
true)
const;
372 const std::vector<int>
getOptIntVector(
int attr,
const char* objectid,
bool& ok,
bool report =
true)
const;
381 virtual std::string
getName(
int attr)
const = 0;
412 void emitUngivenError(
const std::string& attrname,
const char* objectid)
const;
413 void emitEmptyError(
const std::string& attrname,
const char* objectid)
const;
414 void emitFormatError(
const std::string& attrname,
const std::string& type,
const char* objectid)
const;
481 static const std::vector<std::string>
value;
486 static const std::vector<int>
value;
491 template <
typename T>
493 bool& ok,
bool report)
const {
502 return getInternal<T>(attr);
517 template <
typename T>
519 bool& ok, T defaultValue,
bool report)
const {
524 return getInternal<T>(attr);
virtual void serialize(std::ostream &os) const =0
Prints all attribute names and values into the given stream.
const std::vector< std::string > getStringVector(int attr) const
Tries to read given attribute assuming it is a string vector.
FringeType
algorithms for computing right of way
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
static const std::vector< std::string > value
static const std::string type
static const std::string type
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
static const std::string type
virtual int getInt(int id) const =0
Returns the int-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<>
SUMOSAXAttributes & operator=(const SUMOSAXAttributes &src)
Invalidated assignment operator.
static const std::string type
std::string myObjectType
the object type to use in error reporting
const std::string & getObjectType() const
return the objecttype to which these attributes belong
virtual SUMOSAXAttributes * clone() const =0
return a new deep-copy attributes object
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
static const Boundary value
virtual bool getBool(int id) const =0
Returns the bool-value of the named (by its enum-value) attribute.
virtual double getFloat(int id) const =0
Returns the double-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.
T getInternal(const int attr) const
static const std::string value
void emitFormatError(const std::string &attrname, const std::string &type, const char *objectid) const
virtual FringeType getFringeType(bool &ok) const =0
returns fringe type
virtual ~SUMOSAXAttributes()
Destructor.
virtual PositionVector getShape(int attr) const =0
Tries to read given attribute assuming it is a PositionVector.
static const std::string type
static const long long int value
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
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<>
static const std::string type
static const std::string type
void emitUngivenError(const std::string &attrname, const char *objectid) const
A class that stores a 2D geometrical boundary.
virtual bool hasAttribute(const std::string &id) const =0
Returns the information whether the named attribute is within the current list.
virtual RightOfWay getRightOfWay(bool &ok) const =0
Returns the right-of-way method.
const std::vector< int > getIntVector(int attr) const
Tries to read given attribute assuming it is an int vector.
static const std::string type
virtual double getFloat(const std::string &id) const =0
Returns the double-value of the named 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.
std::ostream & operator<<(std::ostream &os, const SUMOSAXAttributes &src)
virtual Boundary getBoundary(int attr) const =0
Tries to read given attribute assuming it is a Boundary.
static const std::string type
static const PositionVector value
virtual std::string getName(int attr) const =0
Converts the given attribute id into a man readable string.
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.
SUMOSAXAttributes(const SUMOSAXAttributes &src)
Invalidated copy constructor.
RightOfWay
algorithms for computing right of way
static const std::vector< int > value
virtual SumoXMLNodeType getNodeType(bool &ok) const =0
Returns the value of the named attribute.
static const std::string ENCODING
The encoding of parsed strings.
SUMOSAXAttributes(const std::string &objectType)
void emitEmptyError(const std::string &attrname, const char *objectid) const
static const std::string type
friend std::ostream & operator<<(std::ostream &os, const SUMOSAXAttributes &src)
virtual SumoXMLEdgeFunc getEdgeFunc(bool &ok) const =0
Returns the value of the named attribute.
virtual std::string getStringSecure(int id, const std::string &def) const =0
Returns the string-value of the named (by its enum-value) attribute.
static const double value
static const std::string type
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 long long int getLong(int id) const =0
Returns the long-value of the named (by its enum-value) attribute.
Encapsulated SAX-Attributes.
virtual RGBColor getColor() const =0
Returns the value of the named attribute.
virtual std::vector< std::string > getAttributeNames() const =0
Retrieves all attribute names.
static const RGBColor value