SUMO - Simulation of Urban MObility
OutputFormatter.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Abstract base class for output formatters
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef OutputFormatter_h
22 #define OutputFormatter_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <vector>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class Boundary;
43 class Position;
44 class PositionVector;
45 class RGBColor;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
60 public:
62  virtual ~OutputFormatter() { }
63 
64 
77  virtual bool writeXMLHeader(std::ostream& into, const std::string& rootElement,
78  const std::string& attrs = "",
79  const std::string& comment = "") = 0;
80 
81 
92  virtual void openTag(std::ostream& into, const std::string& xmlElement) = 0;
93 
94 
102  virtual void openTag(std::ostream& into, const SumoXMLTag& xmlElement) = 0;
103 
104 
111  virtual bool closeTag(std::ostream& into) = 0;
112 
113  virtual void writePreformattedTag(std::ostream& into, const std::string& val) = 0;
114 
115 };
116 
117 
118 #endif
119 
120 /****************************************************************************/
121 
SumoXMLTag
Numbers representing SUMO-XML - element names.
virtual bool closeTag(std::ostream &into)=0
Closes the most recently opened tag.
Abstract base class for output formatters.
virtual void writePreformattedTag(std::ostream &into, const std::string &val)=0
virtual ~OutputFormatter()
Destructor.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
virtual void openTag(std::ostream &into, const std::string &xmlElement)=0
Opens an XML tag.
virtual bool writeXMLHeader(std::ostream &into, const std::string &rootElement, const std::string &attrs="", const std::string &comment="")=0
Writes an XML header with optional configuration.