19 #ifndef BinaryFormatter_h 20 #define BinaryFormatter_h 121 bool writeXMLHeader(std::ostream& into,
const std::string& rootElement,
122 const std::map<SumoXMLAttr, std::string>& attrs);
133 template <
typename E>
147 void openTag(std::ostream& into,
const std::string& xmlElement);
166 bool closeTag(std::ostream& into,
const std::string& comment =
"");
175 template <
typename dummy,
typename T>
185 template <
typename dummy,
typename T>
186 static void writeAttr(dummy& into,
const std::string& attr,
const T& val);
204 template <
typename dummy>
205 static void writeAttr(dummy& into,
const SumoXMLAttr attr,
const std::vector<const ROEdge*>& val);
206 template <
typename dummy>
207 static void writeAttr(dummy& into,
const SumoXMLAttr attr,
const std::vector<const MSEdge*>& val);
219 const int attrNum = (int)attr;
242 static void writeStringList(std::ostream& into,
const std::vector<std::string>& list);
261 template <
typename E>
265 const int numEdges = (
const int)E::getAllEdges().size();
268 for (
int i = 0; i < numEdges; i++) {
274 for (
int i = 0; i < numEdges; i++) {
275 E* e = E::getAllEdges()[i];
278 for (
int j = 0; j < e->getNumSuccessors(); j++) {
290 template <
typename dummy,
typename T>
297 template <
typename dummy,
typename T>
317 template <
typename dummy>
324 template <
typename dummy>
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
A road/street connecting two junctions.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A point in 2D or 3D with translation and scaling methods.
static std::ostream & writeInt(std::ostream &strm, int value)
Writes an integer binary.
static std::ostream & writeByte(std::ostream &strm, unsigned char value)
Writes a byte binary.
A basic edge for routing applications.
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
static StringBijection< int > Attrs
The names of SUMO-XML attributes for use in netbuild.
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
static std::ostream & writeEdgeVector(std::ostream &os, const std::vector< E > &edges)
Writes an edge vector binary.
static std::ostream & writeString(std::ostream &strm, const std::string &value)
Writes a string binary.