Code_TYMPAN  4.4.0
Industrial site acoustic simulation
plugin.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2014> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
16 #ifndef TY_PLUGIN
17 #define TY_PLUGIN
18 
19 #include <string>
20 
21 #include "Tympan/core/defines.h"
22 #include "Tympan/core/idgen.h"
23 #include "Tympan/core/interfaces.h"
24 
25 #ifdef _WIN32
26  #pragma warning(disable : 4251)
27 #endif
28 
29 #if TY_COMPILER == TY_COMPILER_MSVC
30  #ifdef _PLUGIN_DLL
31  #define PLUGIN_DECL __declspec(dllexport)
32  #else
33  #define PLUGIN_DECL __declspec(dllimport)
34  #endif
35 #else
36  #define PLUGIN_DECL
37 #endif
38 
39 typedef struct
40 {
41  QString _name;
42  QString _author;
43  QString _version;
44  QString _description;
45 } pluginInfos;
46 
47 class Plugin
48 {
49 public:
50  Plugin() : _pSolver(0) {}
52  {
53  if (_pSolver)
54  {
55  delete _pSolver;
56  }
57  }
58 
59  // Set des informations
60  void setName(const QString& name)
61  {
62  _name = name;
63  }
64  void setAuthor(const QString& author)
65  {
66  _author = author;
67  }
68  void setVersion(const QString& version)
69  {
70  _version = version;
71  }
72  void setDescription(const QString& description)
73  {
74  _description = description;
75  }
76  void setUUID(const OGenID& uuid)
77  {
78  _uuid = uuid;
79  }
80 
81  // Get des informations
82  QString getName() const
83  {
84  return _name;
85  }
86  QString getAuthor() const
87  {
88  return _author;
89  }
90  QString getVersion() const
91  {
92  return _version;
93  }
94  QString getDescription() const
95  {
96  return _description;
97  }
98 
99  void getInfos(pluginInfos* pInfos)
100  {
101  pInfos->_name = _name;
102  pInfos->_author = _author;
103  pInfos->_version = _version;
104  pInfos->_description = _description;
105  }
106 
107  OGenID getUUID() const
108  {
109  return _uuid;
110  }
111 
112  // Set du solver
114  {
115  _pSolver = solver;
116  }
117 
118  // Get du solver
120  {
121  return _pSolver;
122  }
123 
124 private:
125  // Pointeur sur le SolverInterface
127 
128  // Informations sur le plugin
129  QString _name;
130  QString _author;
131  QString _version;
132  QString _description;
134 };
135 
136 #endif // TY_PLUGIN
const char * name
Definition: idgen.h:28
Definition: plugin.h:48
QString _version
Definition: plugin.h:131
QString getName() const
Definition: plugin.h:82
void setSolver(SolverInterface *solver)
Definition: plugin.h:113
SolverInterface * _pSolver
Definition: plugin.h:126
OGenID _uuid
Definition: plugin.h:133
void setUUID(const OGenID &uuid)
Definition: plugin.h:76
QString _author
Definition: plugin.h:130
QString _name
Definition: plugin.h:129
void getInfos(pluginInfos *pInfos)
Definition: plugin.h:99
QString getVersion() const
Definition: plugin.h:90
OGenID getUUID() const
Definition: plugin.h:107
void setDescription(const QString &description)
Definition: plugin.h:72
Plugin()
Definition: plugin.h:50
void setName(const QString &name)
Definition: plugin.h:60
QString getDescription() const
Definition: plugin.h:94
void setVersion(const QString &version)
Definition: plugin.h:68
void setAuthor(const QString &author)
Definition: plugin.h:64
QString getAuthor() const
Definition: plugin.h:86
QString _description
Definition: plugin.h:132
~Plugin()
Definition: plugin.h:51
SolverInterface * getSolver() const
Definition: plugin.h:119
Interface class for solvers.
Definition: interfaces.h:33
QString _author
Definition: plugin.h:42
QString _version
Definition: plugin.h:43
QString _name
Definition: plugin.h:41
QString _description
Definition: plugin.h:44