 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
24 #include <xercesc/sax2/Attributes.hpp>
25 #include <xercesc/sax2/DefaultHandler.hpp>
26 #include <xercesc/util/XercesVersion.hpp>
27 #include <xercesc/util/TransService.hpp>
28 #include <xercesc/util/TranscodingException.hpp>
43 const std::map<std::string, std::string>& attrs,
44 const std::map<int, std::string>& predefinedTagsMML,
45 const std::string& objectType) :
48 myPredefinedTagsMML(predefinedTagsMML) { }
52 const std::map<SumoXMLAttr, std::string>& attrs,
53 const std::map<int, std::string>& predefinedTagsMML,
54 const std::string& objectType) :
56 myPredefinedTagsMML(predefinedTagsMML) {
58 for (
const auto& i : attrs) {
104 return result.size() == 0 ? str : result;
118 return myAttrs.find(i->second)->second;
136 const std::string& str)
const {
137 std::map<std::string, std::string>::const_iterator it =
myAttrs.find(
id);
138 if (it !=
myAttrs.end() && it->second !=
"") {
208 if (pos.size() != 2 && pos.size() != 3) {
213 if (pos.size() == 2) {
228 if (st.
size() != 4) {
235 return Boundary(xmin, ymin, xmax, ymax);
250 for (std::map<std::string, std::string>::const_iterator it =
myAttrs.begin(); it !=
myAttrs.end(); ++it) {
251 os <<
" " << it->first;
252 os <<
"=\"" << it->second <<
"\"";
256 std::vector<std::string>
258 std::vector<std::string> result;
259 for (std::map<std::string, std::string>::const_iterator it =
myAttrs.begin(); it !=
myAttrs.end(); ++it) {
260 result.push_back(it->first);
FringeType
algorithms for computing right of way
FringeType getFringeType(bool &ok) const
returns fringe type
Boundary getBoundary(int attr) const
Tries to read given attribute assuming it is a Boundary.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
double getFloat(int id) const
Returns the double-value of the named (by its enum-value) attribute.
SumoXMLNodeType getNodeType(bool &ok) const
Returns the value of the named attribute.
std::string getStringSecure(int id, const std::string &def) const
Returns the string-value of the named (by its enum-value) attribute.
bool hasNext()
returns the information whether further substrings exist
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
std::string getString(int id) const
Returns the string-value of the named (by its enum-value) attribute.
bool getBool(int id) const
Returns the bool-value of the named (by its enum-value) attribute.
static StringBijection< RightOfWay > RightOfWayValues
righ of way algorithms
std::map< std::string, std::string > myAttrs
The encapsulated attributes.
const std::string & getObjectType() const
return the objecttype to which these attributes belong
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
bool hasAttribute(int id) const
Returns the information whether the named (by its enum-value) attribute is within the current list.
SUMOSAXAttributesImpl_Cached(const std::map< std::string, std::string > &attrs, const std::map< int, std::string > &predefinedTagsMML, const std::string &objectType)
Constructor.
SumoXMLEdgeFunc getEdgeFunc(bool &ok) const
Returns the value of the named attribute.
SUMOSAXAttributes * clone() const
return a new deep-copy attributes object
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
T get(const std::string &str) const
RightOfWay getRightOfWay(bool &ok) const
returns rightOfWay method
static RGBColor parseColor(std::string coldef)
Parses a color information.
A class that stores a 2D geometrical boundary.
A point in 2D or 3D with translation and scaling methods.
int getInt(int id) const
Returns the int-value of the named (by its enum-value) attribute.
long long int getLong(int id) const
Returns the long-value of the named (by its enum-value) attribute.
int size() const
returns the number of existing substrings
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
std::string getName(int attr) const
Converts the given attribute id into a man readable string.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
const std::string & getAttributeValueSecure(int id) const
Returns Xerces-value of the named attribute.
RightOfWay
algorithms for computing right of way
static StringBijection< SumoXMLEdgeFunc > EdgeFunctions
edge functions
How to compute right of way.
void serialize(std::ostream &os) const
Prints all attribute names and values into the given stream.
static StringBijection< FringeType > FringeTypeValues
fringe types
std::vector< std::string > getAttributeNames() const
Retrieves all attribute names.
static long long int toLong(const std::string &sData)
converts a string into the long value described by it by calling the char-type converter,...
~SUMOSAXAttributesImpl_Cached()
Destructor.
PositionVector getShape(int attr) const
Tries to read given attribute assuming it is a PositionVector.
RGBColor getColor() const
Returns the value of the named attribute.
const std::map< int, std::string > & myPredefinedTagsMML
Map of attribute ids to their (readable) string-representation.
Encapsulated SAX-Attributes.
static StringBijection< SumoXMLNodeType > NodeTypes
node types