21 #ifndef BinaryFormatter_h 22 #define BinaryFormatter_h 127 bool writeXMLHeader(std::ostream& into,
const std::string& rootElement,
128 const std::map<SumoXMLAttr, std::string>& attrs);
139 template <
typename E>
153 void openTag(std::ostream& into,
const std::string& xmlElement);
181 template <
typename dummy,
typename T>
191 template <
typename dummy,
typename T>
192 static void writeAttr(dummy& into,
const std::string& attr,
const T& val);
208 template <
typename dummy>
209 static void writeAttr(dummy& into,
const SumoXMLAttr attr,
const std::vector<const ROEdge*>& val);
210 template <
typename dummy>
211 static void writeAttr(dummy& into,
const SumoXMLAttr attr,
const std::vector<const MSEdge*>& val);
223 const int attrNum = (int)attr;
246 static void writeStringList(std::ostream& into,
const std::vector<std::string>& list);
265 template <
typename E>
269 const int numEdges = (
const int)E::getAllEdges().size();
272 for (
int i = 0; i < numEdges; i++) {
278 for (
int i = 0; i < numEdges; i++) {
279 E* e = E::getAllEdges()[i];
282 for (
int j = 0; j < e->getNumSuccessors(); j++) {
294 template <
typename dummy,
typename T>
301 template <
typename dummy,
typename T>
321 template <
typename dummy>
328 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.