Manual for OpenFLUID 2.1.11

PluggableFeatureExtension.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 PluggableFeatureExtension.hpp
35 
36  @author Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
37 */
38 
39 
40 #ifndef __OPENFLUID_BUILDEREXT_PLUGGABLEFEATUREEXTENSION_HPP__
41 #define __OPENFLUID_BUILDEREXT_PLUGGABLEFEATUREEXTENSION_HPP__
42 
43 
46 
47 
48 /**
49  Macro for the beginning of definition of signature for feature extension
50 
51  @cond OpenFLUID:completion
52  {
53  "contexts" : ["BUILDEREXT"],
54  "menupath" : ["Signature"],
55  "title" : "Insert signature block",
56  "text" : "BEGIN_BUILDEREXT_SIGNATURE(\"%%SEL_START%%bext.id%%SEL_END%%\",exttype)\n\nEND_BUILDEREXT_SIGNATURE"
57  }
58  @endcond
59 */
60 #ifndef BEGIN_BUILDEREXT_SIGNATURE
61 #define BEGIN_BUILDEREXT_SIGNATURE(id,extmode) \
62  extern "C" { \
63  OPENFLUID_PLUGIN openfluid::builderext::BuilderExtensionSignature* WARESIGNATURE_PROC_DECL() \
64  { \
65  openfluid::builderext::BuilderExtensionSignature* Signature =\
66  new openfluid::builderext::BuilderExtensionSignature(); \
67  Signature->ID = (id); \
68  Signature->Mode = (extmode);\
69  Signature->Type = openfluid::builderext::TYPE_FEATURE; \
70  Signature->BuildInfo.SDKVersion = openfluid::config::VERSION_FULL; \
71  Signature->BuildInfo.BuildType = (WAREBUILD_BUILD_TYPE); \
72  Signature->BuildInfo.CompilerID = (WAREBUILD_COMPILER_ID); \
73  Signature->BuildInfo.CompilerVersion = (WAREBUILD_COMPILER_VERSION); \
74  Signature->BuildInfo.CompilationFlags = (WAREBUILD_COMPILATION_FLAGS);
75 #endif
76 
77 /**
78  Macro for the end of definition of signature hook
79 */
80 #ifndef END_BUILDEREXT_SIGNATURE
81 #define END_BUILDEREXT_SIGNATURE \
82  return Signature; \
83  } \
84 }
85 #endif
86 
87 
88 // =====================================================================
89 // =====================================================================
90 
91 
92 /**
93  Macro for declaration of a Builder extension configuration parameter
94  @param[in] name name of the parameter
95  @param[in] description description of the parameter
96 */
97 #define DECLARE_CONFIGURATION_PARAMETER(name,description) \
98  Signature->ConfigParameters[(name)] = (description);
99 
100 /**
101  @deprecated Since version 2.1.0. Use #DECLARE_CONFIGURATION_PARAMETER instead
102 */
103 #define DECLARE_CONFIGURATION_PARAM(name,description) DECLARE_CONFIGURATION_PARAMETER(name,description)
104 
105 
106 /**
107  Macro for declaration of the Builder extension category
108 
109  @cond OpenFLUID:completion
110  {
111  "contexts" : ["BUILDEREXT"],
112  "menupath" : ["Signature", "Menu context"],
113  "title" : "Declare menu category",
114  "text" : "DECLARE_CATEGORY(%%SEL_START%%category%%SEL_END%%)"
115  }
116  @endcond
117 */
118 #define DECLARE_CATEGORY(category) \
119  Signature->Category = (category);
120 
121 
122 /**
123  Macro for declaration of the Builder extension menu text
124 
125  @cond OpenFLUID:completion
126  {
127  "contexts" : ["BUILDEREXT"],
128  "menupath" : ["Signature", "Menu context"],
129  "title" : "Declare menu text",
130  "text" : "DECLARE_MENUTEXT(\"%%SEL_START%%menu text%%SEL_END%%\")"
131  }
132  @endcond
133 */
134 #define DECLARE_MENUTEXT(menutext) \
135  Signature->MenuText = (menutext);
136 
137 
138 // =====================================================================
139 // =====================================================================
140 
141 
142 namespace openfluid { namespace builderext {
143 
144 
146 {
147 
148  protected:
149 
151 
153 
154 
155  public:
156 
158  { }
159 
160 
162  { }
163 
164 
166  {
167  m_Config = Config;
168  }
169 
170 
172  {
173  mp_Desc = Desc;
174  }
175 
176 
177  virtual bool initialize() = 0;
178 };
179 
180 
181 } } // namespaces
182 
183 
184 #endif /* __OPENFLUID_BUILDEREXT_PLUGGABLEFEATUREEXTENSION_HPP__ */
openfluid::builderext::PluggableFeatureExtension
Definition: PluggableFeatureExtension.hpp:145
OPENFLUID_API
#define OPENFLUID_API
Definition: dllexport.hpp:86
openfluid::builderext::PluggableFeatureExtension::PluggableFeatureExtension
PluggableFeatureExtension()
Definition: PluggableFeatureExtension.hpp:157
PluggableBuilderExtension.hpp
openfluid::fluidx::FluidXDescriptor
Definition: FluidXDescriptor.hpp:70
openfluid::builderext::PluggableFeatureExtension::~PluggableFeatureExtension
virtual ~PluggableFeatureExtension()
Definition: PluggableFeatureExtension.hpp:161
openfluid::builderext::PluggableFeatureExtension::m_Config
openfluid::ware::WareParams_t m_Config
Definition: PluggableFeatureExtension.hpp:152
openfluid::builderext::PluggableFeatureExtension::mp_Desc
openfluid::fluidx::FluidXDescriptor * mp_Desc
Definition: PluggableFeatureExtension.hpp:150
openfluid
Definition: ApplicationException.hpp:47
openfluid::builderext::PluggableFeatureExtension::setFluidXDescriptor
void setFluidXDescriptor(openfluid::fluidx::FluidXDescriptor *Desc)
Definition: PluggableFeatureExtension.hpp:171
FluidXUpdateFlags.hpp
openfluid::builderext::PluggableFeatureExtension::setConfiguration
virtual void setConfiguration(const openfluid::ware::WareParams_t &Config)
Definition: PluggableFeatureExtension.hpp:165
openfluid::builderext::PluggableBuilderExtension
Definition: PluggableBuilderExtension.hpp:54
openfluid::ware::WareParams_t
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition: TypeDefs.hpp:146