Manual for OpenFLUID 2.1.10

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->setABIVersion(openfluid::config::VERSION_FULL); \
68  Signature->ID = (id); \
69  Signature->Mode = (extmode);\
70  Signature->Type = openfluid::builderext::TYPE_FEATURE;
71 #endif
72 
73 /**
74  Macro for the end of definition of signature hook
75 */
76 #ifndef END_BUILDEREXT_SIGNATURE
77 #define END_BUILDEREXT_SIGNATURE \
78  return Signature; \
79  } \
80 }
81 #endif
82 
83 
84 // =====================================================================
85 // =====================================================================
86 
87 
88 /**
89  Macro for declaration of a Builder extension configuration parameter
90  @param[in] name name of the parameter
91  @param[in] description description of the parameter
92 */
93 #define DECLARE_CONFIGURATION_PARAMETER(name,description) \
94  Signature->ConfigParameters[(name)] = (description);
95 
96 /**
97  @deprecated Since version 2.1.0. Use #DECLARE_CONFIGURATION_PARAMETER instead
98 */
99 #define DECLARE_CONFIGURATION_PARAM(name,description) DECLARE_CONFIGURATION_PARAMETER(name,description)
100 
101 
102 /**
103  Macro for declaration of the Builder extension category
104 
105  @cond OpenFLUID:completion
106  {
107  "contexts" : ["BUILDEREXT"],
108  "menupath" : ["Signature", "Menu context"],
109  "title" : "Declare menu category",
110  "text" : "DECLARE_CATEGORY(%%SEL_START%%category%%SEL_END%%)"
111  }
112  @endcond
113 */
114 #define DECLARE_CATEGORY(category) \
115  Signature->Category = (category);
116 
117 
118 /**
119  Macro for declaration of the Builder extension menu text
120 
121  @cond OpenFLUID:completion
122  {
123  "contexts" : ["BUILDEREXT"],
124  "menupath" : ["Signature", "Menu context"],
125  "title" : "Declare menu text",
126  "text" : "DECLARE_MENUTEXT(\"%%SEL_START%%menu text%%SEL_END%%\")"
127  }
128  @endcond
129 */
130 #define DECLARE_MENUTEXT(menutext) \
131  Signature->MenuText = (menutext);
132 
133 
134 // =====================================================================
135 // =====================================================================
136 
137 
138 namespace openfluid { namespace builderext {
139 
140 
142 {
143 
144  protected:
145 
147 
149 
150 
151  public:
152 
154  { }
155 
156 
158  { }
159 
160 
162  {
163  m_Config = Config;
164  }
165 
166 
168  {
169  mp_Desc = Desc;
170  }
171 
172 
173  virtual bool initialize() = 0;
174 };
175 
176 
177 } } // namespaces
178 
179 
180 #endif /* __OPENFLUID_BUILDEREXT_PLUGGABLEFEATUREEXTENSION_HPP__ */
Definition: FluidXDescriptor.hpp:70
Definition: PluggableBuilderExtension.hpp:54
Definition: ApplicationException.hpp:47
PluggableFeatureExtension()
Definition: PluggableFeatureExtension.hpp:153
openfluid::fluidx::FluidXDescriptor * mp_Desc
Definition: PluggableFeatureExtension.hpp:146
virtual ~PluggableFeatureExtension()
Definition: PluggableFeatureExtension.hpp:157
void setFluidXDescriptor(openfluid::fluidx::FluidXDescriptor *Desc)
Definition: PluggableFeatureExtension.hpp:167
virtual void setConfiguration(const openfluid::ware::WareParams_t &Config)
Definition: PluggableFeatureExtension.hpp:161
openfluid::ware::WareParams_t m_Config
Definition: PluggableFeatureExtension.hpp:148
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition: TypeDefs.hpp:128
Definition: PluggableFeatureExtension.hpp:141
#define OPENFLUID_API
Definition: dllexport.hpp:86