MicroModelicaCCompiler  4.5.3
files.hpp
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  This file is part of QSS Solver.
4 
5  QSS Solver is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  QSS Solver is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QSS Solver. If not, see <http://www.gnu.org/licenses/>.
17 
18  ******************************************************************************/
19 
20 #pragma once
21 
22 #include <fstream>
23 #include <list>
24 #include <string>
25 
27 #include <ir/annotation.hpp>
28 #include <ir/class.hpp>
29 #include <util/compile_flags.hpp>
30 
31 namespace MicroModelica {
32 namespace Generator {
33 
34 class Files {
35  public:
36  Files(ModelInstancePtr modelInstance, IR::Model& model, Util::CompileFlags& flags);
37  Files(string name, Util::CompileFlags& flags);
38  ~Files() = default;
39  void makefile();
40  void run();
41  void plot();
42  void settings(IR::ModelAnnotation annotation);
43  void graph();
44  void bdfPartition();
45 
46  protected:
47  std::string variablePlotSettings();
48  void printList(const list<string>& ann, const string& tag) const;
49  void addAnnotation(const IR::ModelAnnotation& annotation, const string& mmo_name, IR::IntegerAnnotations name);
50 
51  string _fname;
52  IR::Model _model;
55  Util::CompileFlags& _flags;
56  ofstream _file;
57 };
58 } // namespace Generator
59 } // namespace MicroModelica
MicroModelica::Generator::Files::~Files
~Files()=default
MicroModelica::Generator::Files::_fname
string _fname
Definition: files.hpp:102
MicroModelica::Generator::Files::_modelInstance
ModelInstancePtr _modelInstance
Definition: files.hpp:104
MicroModelica::Generator::Files::settings
void settings(IR::ModelAnnotation annotation)
Definition: files.cpp:264
MicroModelica::Generator::Files::run
void run()
Definition: files.cpp:175
MicroModelica::Generator::Files::printList
void printList(const list< string > &ann, const string &tag) const
Definition: files.cpp:352
MicroModelica::Generator::Files::graph
void graph()
MicroModelica::IR::IntegerAnnotations
IntegerAnnotations
Definition: annotation.hpp:119
MicroModelica::Generator::Files::_flags
Util::CompileFlags & _flags
Definition: files.hpp:106
MicroModelica::Generator::Files::plot
void plot()
Definition: files.cpp:212
MicroModelica::Generator::Files::bdfPartition
void bdfPartition()
Definition: files.cpp:371
MicroModelica::Generator::Files::addAnnotation
void addAnnotation(const IR::ModelAnnotation &annotation, const string &mmo_name, IR::IntegerAnnotations name)
Definition: files.cpp:343
MicroModelica::Generator::Files::variablePlotSettings
std::string variablePlotSettings()
Definition: files.cpp:198
MicroModelica::Generator::Files::_file
ofstream _file
Definition: files.hpp:107
MicroModelica::Generator::Files::_writer
WriterPtr _writer
Definition: files.hpp:105
compile_flags.hpp
MicroModelica::Generator::Files::_model
IR::Model _model
Definition: files.hpp:103
MicroModelica::Generator::Files::makefile
void makefile()
Definition: files.cpp:65
MicroModelica::Generator::Files::Files
Files(ModelInstancePtr modelInstance, IR::Model &model, Util::CompileFlags &flags)
Definition: files.cpp:50
model_instance.hpp
MicroModelica
Definition: files.cpp:45
annotation.hpp
MicroModelica::Generator::WriterPtr
std::shared_ptr< Writer > WriterPtr
Definition: writer.hpp:146
class.hpp
MicroModelica::Generator::ModelInstancePtr
std::shared_ptr< ModelInstance > ModelInstancePtr
Definition: model_instance.hpp:197