25 #include <xercesc/sax2/Attributes.hpp> 26 #include <xercesc/sax2/DefaultHandler.hpp> 27 #include <xercesc/util/XercesVersion.hpp> 28 #include <xercesc/util/TransService.hpp> 29 #include <xercesc/util/TranscodingException.hpp> 44 const std::map<std::string, std::string>& attrs,
45 const std::map<int, std::string>& predefinedTagsMML,
46 const std::string& objectType) :
49 myPredefinedTagsMML(predefinedTagsMML) { }
93 return result.size() == 0 ? str : result;
107 return myAttrs.find(i->second)->second;
125 const std::string& str)
const {
126 std::map<std::string, std::string>::const_iterator it =
myAttrs.find(
id);
127 if (it !=
myAttrs.end() && it->second !=
"") {
186 if (pos.size() != 2 && pos.size() != 3) {
191 if (pos.size() == 2) {
206 if (st.
size() != 4) {
213 return Boundary(xmin, ymin, xmax, ymax);
217 std::vector<std::string>
220 std::vector<std::string> ret;
237 for (std::map<std::string, std::string>::const_iterator it =
myAttrs.begin(); it !=
myAttrs.end(); ++it) {
238 os <<
" " << it->first;
239 os <<
"=\"" << it->second <<
"\"";
static StringBijection< RightOfWay > RightOfWayValues
lane spread functions
SumoXMLNodeType getNodeType(bool &ok) const
Returns the value of the named attribute.
static StringBijection< SumoXMLNodeType > NodeTypes
node types
static RGBColor parseColor(std::string coldef)
Parses a color information.
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
void serialize(std::ostream &os) const
Prints all attribute names and values into the given stream.
long long int getLong(int id) const
Returns the long-value of the named (by its enum-value) attribute.
RightOfWay
algorithms for computing right of way
Boundary getBoundary(int attr) const
Tries to read given attribute assuming it is a Boundary.
A class that stores a 2D geometrical boundary.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter ...
RGBColor getColor() const
Returns the value of the named attribute.
const std::string & getAttributeValueSecure(int id) const
Returns Xerces-value of the named attribute.
PositionVector getShape(int attr) const
Tries to read given attribute assuming it is a PositionVector.
std::string getName(int attr) const
Converts the given attribute id into a man readable string.
RightOfWay getRightOfWay(bool &ok) const
returns rightOfWay method
const std::map< int, std::string > & myPredefinedTagsMML
Map of attribute ids to their (readable) string-representation.
static void parseStringVector(const std::string &def, std::vector< std::string > &into)
Splits the given string.
How to compute right of way.
Encapsulated SAX-Attributes.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
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.
T get(const std::string &str) const
double getFloat(int id) const
Returns the double-value of the named (by its enum-value) attribute.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
virtual ~SUMOSAXAttributesImpl_Cached()
Destructor.
std::string getStringSecure(int id, const std::string &def) const
Returns the string-value of the named (by its enum-value) attribute.
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.
SUMOSAXAttributes * clone() const
return a new deep-copy attributes object
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
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, which
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
SumoXMLEdgeFunc getEdgeFunc(bool &ok) const
Returns the value of the named attribute.
SUMOSAXAttributesImpl_Cached(const std::map< std::string, std::string > &attrs, const std::map< int, std::string > &predefinedTagsMML, const std::string &objectType)
Constructor.
static StringBijection< SumoXMLEdgeFunc > EdgeFunctions
edge functions
std::map< std::string, std::string > myAttrs
The encapsulated attributes.
bool hasAttribute(int id) const
Returns the information whether the named (by its enum-value) attribute is within the current list...