Eclipse 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-2019 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 /****************************************************************************/
15 // Abstract base class for output formatters
16 /****************************************************************************/
17 #ifndef OutputFormatter_h
18 #define OutputFormatter_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <vector>
29 
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class Boundary;
35 class Position;
36 class PositionVector;
37 class RGBColor;
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
52 public:
54  virtual ~OutputFormatter() { }
55 
56 
68  virtual bool writeXMLHeader(std::ostream& into, const std::string& rootElement,
69  const std::map<SumoXMLAttr, std::string>& attrs) = 0;
70 
71 
82  virtual void openTag(std::ostream& into, const std::string& xmlElement) = 0;
83 
84 
92  virtual void openTag(std::ostream& into, const SumoXMLTag& xmlElement) = 0;
93 
94 
101  virtual bool closeTag(std::ostream& into, const std::string& comment = "") = 0;
102 
103  virtual void writePreformattedTag(std::ostream& into, const std::string& val) = 0;
104 
105  virtual void writePadding(std::ostream& into, const std::string& val) = 0;
106 
107 };
108 
109 
110 #endif
111 
112 /****************************************************************************/
113 
OutputFormatter::writeXMLHeader
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.
OutputFormatter::~OutputFormatter
virtual ~OutputFormatter()
Destructor.
Definition: OutputFormatter.h:54
OutputFormatter::writePreformattedTag
virtual void writePreformattedTag(std::ostream &into, const std::string &val)=0
PositionVector
A list of positions.
Definition: PositionVector.h:45
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
OutputFormatter::openTag
virtual void openTag(std::ostream &into, const std::string &xmlElement)=0
Opens an XML tag.
RGBColor
Definition: RGBColor.h:39
OutputFormatter
Abstract base class for output formatters.
Definition: OutputFormatter.h:51
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
OutputFormatter::openTag
virtual void openTag(std::ostream &into, const SumoXMLTag &xmlElement)=0
Opens an XML tag.
OutputFormatter::writePadding
virtual void writePadding(std::ostream &into, const std::string &val)=0
OutputFormatter::closeTag
virtual bool closeTag(std::ostream &into, const std::string &comment="")=0
Closes the most recently opened tag and optinally add a comment.
config.h
SUMOXMLDefinitions.h