SUMO - Simulation of Urban MObility
OutputFormatter.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // Abstract base class for output formatters
19 /****************************************************************************/
20 #ifndef OutputFormatter_h
21 #define OutputFormatter_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <vector>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class Boundary;
42 class Position;
43 class PositionVector;
44 class RGBColor;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
59 public:
61  virtual ~OutputFormatter() { }
62 
63 
75  virtual bool writeXMLHeader(std::ostream& into, const std::string& rootElement,
76  const std::map<SumoXMLAttr, std::string>& attrs) = 0;
77 
78 
89  virtual void openTag(std::ostream& into, const std::string& xmlElement) = 0;
90 
91 
99  virtual void openTag(std::ostream& into, const SumoXMLTag& xmlElement) = 0;
100 
101 
108  virtual bool closeTag(std::ostream& into) = 0;
109 
110  virtual void writePreformattedTag(std::ostream& into, const std::string& val) = 0;
111 
112 };
113 
114 
115 #endif
116 
117 /****************************************************************************/
118 
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 bool writeXMLHeader(std::ostream &into, const std::string &rootElement, const std::map< SumoXMLAttr, std::string > &attrs)=0
Writes an XML header with optional configuration.
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:47
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
A list of positions.
virtual void openTag(std::ostream &into, const std::string &xmlElement)=0
Opens an XML tag.