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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Abstract base class for output formatters
17 /****************************************************************************/
18 #ifndef OutputFormatter_h
19 #define OutputFormatter_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <vector>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class Boundary;
36 class Position;
37 class PositionVector;
38 class RGBColor;
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
53 public:
55  virtual ~OutputFormatter() { }
56 
57 
69  virtual bool writeXMLHeader(std::ostream& into, const std::string& rootElement,
70  const std::map<SumoXMLAttr, std::string>& attrs) = 0;
71 
72 
83  virtual void openTag(std::ostream& into, const std::string& xmlElement) = 0;
84 
85 
93  virtual void openTag(std::ostream& into, const SumoXMLTag& xmlElement) = 0;
94 
95 
102  virtual bool closeTag(std::ostream& into, const std::string& comment = "") = 0;
103 
104  virtual void writePreformattedTag(std::ostream& into, const std::string& val) = 0;
105 
106  virtual void writePadding(std::ostream& into, const std::string& val) = 0;
107 
108 };
109 
110 
111 #endif
112 
113 /****************************************************************************/
114 
SumoXMLTag
Numbers representing SUMO-XML - element names.
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:42
virtual void writePadding(std::ostream &into, const std::string &val)=0
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
A list of positions.
virtual void openTag(std::ostream &into, const std::string &xmlElement)=0
Opens an XML tag.
virtual bool closeTag(std::ostream &into, const std::string &comment="")=0
Closes the most recently opened tag and optinally add a comment.