generator  1.2
XmlWriter.h
Go to the documentation of this file.
1 /*
2  This file is part of the GeneratorOfDatasets program.
3 
4  GeneratorOfDatasets is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  GeneratorOfDatasets is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with GeneratorOfDatasets. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #ifndef HLIDAC_PES_XML_WRITER_H
18 #define HLIDAC_PES_XML_WRITER_H
19 
26 #include <iostream>
27 #include <map>
28 #include <string>
29 #include <vector>
30 #include <utility>
31 #include "Settings.h"
32 #include "RoboticLine.h"
33 
38 struct Indent {
39  Indent(const uint32_t& indent) : mIndent(indent) { }
40  uint32_t mIndent;
41 };
42 
48 std::ostream& operator<<(std::ostream& out, const Indent& indent);
49 
55 class XmlWriter {
56  public:
61  XmlWriter(const std::vector<RoboticLine*>& lines) : mLines(lines) { }
62 
67  void writeXmlFile(std::string filename = Settings::OUTPUT_FILE);
68 
69  private:
70 
78  void writeInstanceXmlPart(std::ostream& out, RoboticLine* line, const uint32_t& lineId, uint32_t length);
86  void writeRobotXmlPart(std::ostream& out, Robot* robot, const uint32_t& robotId, uint32_t length);
93  void writeStaticActivityXmlPart(std::ostream& out, StaticActivity* a, uint32_t length);
100  void writeDynamicActivityXmlPart(std::ostream& out, DynamicActivity* a, uint32_t length);
107  void writeInterRobotOperationsXmlPart(std::ostream& out, RoboticLine* line, uint32_t length);
114  void writeCollisionsXmlPart(std::ostream& out, RoboticLine* line, uint32_t length);
115 
117  std::vector<RoboticLine*> mLines;
118 };
119 
120 #endif
121 
void writeRobotXmlPart(std::ostream &out, Robot *robot, const uint32_t &robotId, uint32_t length)
It writes a part of the xml file corresponding to one robot.
Definition: XmlWriter.cpp:81
void writeCollisionsXmlPart(std::ostream &out, RoboticLine *line, uint32_t length)
It writes a part of the xml file corresponding to the spatial collisions.
Definition: XmlWriter.cpp:221
std::ostream & operator<<(std::ostream &out, const Indent &indent)
It writes the white space to the output. It is an auxiliary method for XmlWriter class.
Definition: XmlWriter.cpp:26
Instance of the class includes all the data structures and methods related to a robot.
Definition: RoboticLine.h:297
void writeDynamicActivityXmlPart(std::ostream &out, DynamicActivity *a, uint32_t length)
It writes a part of the xml file corresponding to one dynamic activity.
Definition: XmlWriter.cpp:150
Collection of movements between two static activities.
Definition: RoboticLine.h:270
void writeInstanceXmlPart(std::ostream &out, RoboticLine *line, const uint32_t &lineId, uint32_t length)
It writes a part of the xml file corresponding to one robotic cell.
Definition: XmlWriter.cpp:63
void writeXmlFile(std::string filename=Settings::OUTPUT_FILE)
It transforms the instances of the robotic cells to the form of the xml file.
Definition: XmlWriter.cpp:31
Collection of locations in which a robot operation can be performed.
Definition: RoboticLine.h:241
std::vector< RoboticLine * > mLines
Robotic cells to be written to the xml file.
Definition: XmlWriter.h:117
XmlWriter(const std::vector< RoboticLine * > &lines)
It initialises the XmlWriter instance by the given robotic cells.
Definition: XmlWriter.h:61
It declares the namespace for program settings.
Auxiliary structure corresponding to the tabulator in an xml file.
Definition: XmlWriter.h:38
void writeInterRobotOperationsXmlPart(std::ostream &out, RoboticLine *line, uint32_t length)
It writes a part of the xml file corresponding to the inter-robot operations.
Definition: XmlWriter.cpp:184
It writes problem instances to the xml file.
Definition: XmlWriter.h:55
The robotic cell corresponds to an instance of this class.
Definition: RoboticLine.h:553
The file contains various classes devoted to abstract representation of the robotic cell...
void writeStaticActivityXmlPart(std::ostream &out, StaticActivity *a, uint32_t length)
It writes a part of the xml file corresponding to one static activity.
Definition: XmlWriter.cpp:124