Actin®  Version 5.3.0
Software for Robotics Simulation and Control
ecXmlOutputWriter.h
Go to the documentation of this file.
1 #ifndef ecXmlOutputWriter_H_
2 #define ecXmlOutputWriter_H_
3 //------------------------------------------------------------------------------
4 // Copyright (c) 2006-2013 Energid Technologies. All rights reserved.
5 //
10 //
11 //------------------------------------------------------------------------------
12 #include <actin/actin_config.h> // Required to be first header.
13 #include <xml/ecXmlWriter.h>
14 
15 #include "ecBaseOutputWriter.h"
16 #include "ecSystemDataVector.h"
17 
21 {
22 public:
25  (
26  );
27 
29  virtual ~EcXmlOutputWriter
30  (
31  );
32 
35  (
36  const EcXmlOutputWriter& orig
37  );
38 
40  EcXmlOutputWriter& operator=
41  (
42  const EcXmlOutputWriter& orig
43  );
44 
46  EcBoolean operator==
47  (
48  const EcXmlOutputWriter& orig
49  ) const;
50 
52  virtual EcBoolean xmlInit
53  (
54  ) EC_OVERRIDE;
55 
57  virtual EcXmlObject* clone
58  (
59  ) const EC_OVERRIDE;
60 
62  virtual void registerComponents
63  (
64  ) EC_OVERRIDE;
65 
67  virtual EcBoolean equality
68  (
69  const EcXmlObject* other
70  ) const EC_OVERRIDE;
71 
73  virtual EcXmlObject* newObject
74  (
75  ) const EC_OVERRIDE;
76 
77  // returns the token for this class
78  virtual const EcToken& token
79  (
80  ) const EC_OVERRIDE;
81 
83  virtual const EcString& formatDescriptor
84  (
85  ) const EC_OVERRIDE;
86 
88  virtual const EcString& fileExtension
89  (
90  ) const EC_OVERRIDE;
91 
93  virtual void openFile
94  (
95  const EcString& fileName,
96  std::ofstream& stream
97  ) EC_OVERRIDE;
98 
100  virtual void initialize
101  (
102  const EcSystemDataVector& dataVector,
103  std::ostream& stream
104  ) EC_OVERRIDE;
105 
107  virtual void finalize
108  (
109  const EcSystemDataVector& dataVector,
110  std::ostream& stream
111  ) EC_OVERRIDE;
112 
114 
118  virtual void writeComponentOpening
119  (
120  const EcBaseSystemDataComponent& component,
121  std::ostream& stream
122  ) const EC_OVERRIDE;
123 
125 
129  virtual void writeDataComponent
130  (
131  const EcBaseSystemDataComponent& component,
132  std::ostream& stream
133  ) const EC_OVERRIDE;
134 
136 
140  virtual void writeComponentClosing
141  (
142  const EcBaseSystemDataComponent& component,
143  std::ostream& stream
144  ) const EC_OVERRIDE;
145 
147  virtual EcBoolean read
148  (
149  EcXmlReader& stream
150  ) EC_OVERRIDE;
151 
153  virtual EcBoolean write
154  (
155  EcXmlWriter& stream
156  ) const EC_OVERRIDE;
157 
159  static EcXmlOutputWriter nullObject
160  (
161  );
162 
164 
167  static const EcToken& classToken
168  (
169  );
170 
172 
175  static EcXmlObject* creator
176  (
177  );
178 
179 protected:
182 
185 
188 
191 };
192 
193 #endif // ecXmlOutputWriter_H_
#define EC_OVERRIDE
Add wrapper around c++11 override keyword.
Definition: ecMacros.h:36
virtual void finalize(const EcSystemDataVector &dataVector, std::ostream &stream)=0
finalize the writer if necessary
virtual EcBoolean xmlInit() EC_OVERRIDE
xmlInitialize
Holds a base class for elements of system data description.
An EcString-like class that holds a tag and a namespace.
Definition: ecToken.h:41
static const EcString m_TheFormatDescriptor
a string containing the format descriptor "XML"
A base class for xml objects.
Definition: ecXmlObject.h:23
Holds a vector of various types of system data.
virtual void initialize(const EcSystemDataVector &dataVector, std::ostream &stream)=0
initialize the writer if necessary
virtual void registerComponents()=0
register components
static const EcString m_TheFileExtension
a string containing the file extension for text format (.xml)
EcSystemDataVector m_UtilityDataVector
a utility (empty) vector object helping in saving to XML file
virtual const EcString & fileExtension() const =0
return the file extension of the format that this writer is writing in. For example, ".m" for MATLAB or ".txt" for plain text.
virtual void writeDataComponent(const EcBaseSystemDataComponent &component, std::ostream &stream) const =0
write a data component to an output stream
EcXmlWriter * m_pWriter
an XML writer pointer
virtual EcBoolean read(EcXmlReader &stream) EC_OVERRIDE
read object from an XML stream
Holds a base class for writing output to files.
virtual EcBoolean write(EcXmlWriter &stream) const EC_OVERRIDE
write object to an XML stream
virtual EcXmlObject * clone() const =0
clone
bool EcBoolean
Boolean (0 or 1)
Definition: ecTypes.h:21
XML file writer.
Definition: ecXmlWriter.h:19
virtual EcBoolean equality(const EcXmlObject *other) const =0
equality - a virtual equality to an EcXmlObject pointer
virtual void writeComponentClosing(const EcBaseSystemDataComponent &component, std::ostream &stream) const =0
write the closing of a data component to an output stream
virtual void openFile(const EcString &fileName, std::ofstream &stream)=0
open file
virtual EcXmlObject * newObject() const =0
creates new object - a virtual new to an EcXmlObject pointer
std::basic_string< char > EcString
a character string
Definition: ecTypes.h:116
virtual void writeComponentOpening(const EcBaseSystemDataComponent &component, std::ostream &stream) const =0
write the opening of a data component to an output stream
An XML file reader.
Definition: ecXmlReader.h:17
virtual const EcToken & token() const EC_OVERRIDE=0
gets the xml token used for writing out.
Configuration header for the actin hierarchy.
A class for writing simulation outputs to files in XML format.
#define EC_ACTIN_SYSTEMSIMULATION_DECL
simulationAnalysis directory
Definition: actin_config.h:373
virtual const EcString & formatDescriptor() const =0
return the descriptor of the file format. For example, "MATLAB", "Plain Text", "Mathematica", etc.
Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.