Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
OutputFormatter.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2012-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// Abstract base class for output formatters
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
24#include <string>
25#include <vector>
27
28
29// ===========================================================================
30// class declarations
31// ===========================================================================
32class Boundary;
33class Position;
34class PositionVector;
35class RGBColor;
36
37
38// ===========================================================================
39// class definitions
40// ===========================================================================
50public:
52 virtual ~OutputFormatter() { }
53
54
66 virtual bool writeXMLHeader(std::ostream& into, const std::string& rootElement,
67 const std::map<SumoXMLAttr, std::string>& attrs,
68 bool includeConfig = true) = 0;
69
70
81 virtual void openTag(std::ostream& into, const std::string& xmlElement) = 0;
82
83
91 virtual void openTag(std::ostream& into, const SumoXMLTag& xmlElement) = 0;
92
93
100 virtual bool closeTag(std::ostream& into, const std::string& comment = "") = 0;
101
102 virtual void writePreformattedTag(std::ostream& into, const std::string& val) = 0;
103
104 virtual void writePadding(std::ostream& into, const std::string& val) = 0;
105
106 virtual bool wroteHeader() const = 0;
107};
SumoXMLTag
Numbers representing SUMO-XML - element names.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
Abstract base class for output formatters.
virtual void writePreformattedTag(std::ostream &into, const std::string &val)=0
virtual bool writeXMLHeader(std::ostream &into, const std::string &rootElement, const std::map< SumoXMLAttr, std::string > &attrs, bool includeConfig=true)=0
Writes an XML header with optional configuration.
virtual void writePadding(std::ostream &into, const std::string &val)=0
virtual ~OutputFormatter()
Destructor.
virtual bool closeTag(std::ostream &into, const std::string &comment="")=0
Closes the most recently opened tag and optinally add a comment.
virtual void openTag(std::ostream &into, const std::string &xmlElement)=0
Opens an XML tag.
virtual bool wroteHeader() const =0
virtual void openTag(std::ostream &into, const SumoXMLTag &xmlElement)=0
Opens an XML tag.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.