PluggableParameterizationExtension.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 
33 /**
34  @file PluggableParameterizationExtension.hpp
35 
36  @author Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
37 */
38 
39 
40 #ifndef __OPENFLUID_BUILDEREXT_PLUGGABLEPARAMETERIZATIONEXTENSION_HPP__
41 #define __OPENFLUID_BUILDEREXT_PLUGGABLEPARAMETERIZATIONEXTENSION_HPP__
42 
43 
44 #include <QWidget>
45 
47 
48 
49 /**
50  Macro for the beginning of definition of signature for parameterization extension
51 */
52 #ifndef BEGIN_BUILDEREXT_SIGNATURE
53 #define BEGIN_BUILDEREXT_SIGNATURE(id) \
54  extern "C" { \
55  OPENFLUID_PLUGIN openfluid::builderext::BuilderExtensionSignature* WARESIGNATURE_PROC_DECL() \
56  { \
57  openfluid::builderext::BuilderExtensionSignature* Signature =\
58  new openfluid::builderext::BuilderExtensionSignature(); \
59  Signature->setABIVersion(openfluid::config::VERSION_FULL); \
60  Signature->ID = (id); \
61  Signature->Type = openfluid::builderext::TYPE_PARAMETERIZATION;
62 #endif
63 
64 /**
65  Macro for the end of definition of signature hook
66 */
67 #ifndef END_BUILDEREXT_SIGNATURE
68 #define END_BUILDEREXT_SIGNATURE \
69  return Signature; \
70  } \
71 }
72 #endif
73 
74 
75 // =====================================================================
76 // =====================================================================
77 
78 
79 namespace openfluid { namespace builderext {
80 
81 
83 {
84  Q_OBJECT;
85 
86  protected:
87 
89 
91 
92 
93  signals:
94 
95  void changed();
96 
97 
98  public:
99 
101  mp_Desc(nullptr), mp_Params(nullptr)
102  {
103 
104  }
105 
106 
108  {
109  mp_Params = Params;
110  }
111 
112 
114  {
115 
116  }
117 
118 
120  {
121  mp_Desc = Desc;
122  }
123 
124  virtual void update() = 0;
125 
126 };
127 
128 
129 } } // namespaces
130 
131 
132 #endif /* __OPENFLUID_PLUGGABLEPARAMETERIZATIONEXTENSION_HPP__ */
PluggableParameterizationExtension()
Definition: PluggableParameterizationExtension.hpp:100
Definition: FluidXDescriptor.hpp:70
Definition: PluggableParameterizationExtension.hpp:82
void setFluidXDescriptor(const openfluid::fluidx::FluidXDescriptor *Desc)
Definition: PluggableParameterizationExtension.hpp:119
Definition: ApplicationException.hpp:47
void linkParams(openfluid::ware::WareParams_t *Params)
Definition: PluggableParameterizationExtension.hpp:107
Definition: PluggableBuilderExtension.hpp:86
#define OPENFLUID_API
Definition: dllexport.hpp:86
openfluid::ware::WareParams_t * mp_Params
Definition: PluggableParameterizationExtension.hpp:90
virtual ~PluggableParameterizationExtension()
Definition: PluggableParameterizationExtension.hpp:113
const openfluid::fluidx::FluidXDescriptor * mp_Desc
Definition: PluggableParameterizationExtension.hpp:84
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition: TypeDefs.hpp:128