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  @file PluggableFeatureExtension.hpp
34 
35  @author Jean-Christophe FABRE <jean-christophe.fabre@supagro.inra.fr>
36 */
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 #ifndef BEGIN_BUILDEREXT_SIGNATURE
52 #define BEGIN_BUILDEREXT_SIGNATURE(id,extmode) \
53  extern "C" { \
54  OPENFLUID_PLUGIN openfluid::builderext::BuilderExtensionSignature* WARESIGNATURE_PROC_DECL() \
55  { \
56  openfluid::builderext::BuilderExtensionSignature* Signature =\
57  new openfluid::builderext::BuilderExtensionSignature(); \
58  Signature->setABIVersion(openfluid::config::VERSION_FULL); \
59  Signature->ID = (id); \
60  Signature->Mode = (extmode);\
61  Signature->Type = openfluid::builderext::TYPE_FEATURE;
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 /**
80  Macro for declaration of a Builder extension configuration parameter
81  @param[in] name name of the parameter
82  @param[in] description description of the parameter
83 */
84 #define DECLARE_CONFIGURATION_PARAMETER(name,description) \
85  Signature->ConfigParameters[(name)] = (description);
86 
87 /**
88  @deprecated Since version 2.1.0. Use #DECLARE_CONFIGURATION_PARAMETER instead
89 */
90 #define DECLARE_CONFIGURATION_PARAM(name,description) DECLARE_CONFIGURATION_PARAMETER(name,description)
91 
92 
93 /**
94  Macro for declaration of the Builder extension category
95 */
96 #define DECLARE_CATEGORY(category) Signature->Category = (category);
97 
98 
99 /**
100  Macro for declaration of the Builder extension menu text
101 */
102 #define DECLARE_MENUTEXT(menutext) Signature->MenuText = (menutext);
103 
104 
105 // =====================================================================
106 // =====================================================================
107 
108 
109 namespace openfluid { namespace builderext {
110 
111 
113 {
114 
115  protected:
116 
118 
120 
121 
122  public:
123 
124  PluggableFeatureExtension() : PluggableBuilderExtension(), mp_AdvancedDesc(nullptr)
125  { }
126 
127 
129  { }
130 
131 
133  { m_Config = Config; }
134 
135 
137  { mp_AdvancedDesc = Desc; }
138 
139 
140  virtual bool initialize() = 0;
141 };
142 
143 
144 } } // namespaces
145 
146 
147 #endif /* __OPENFLUID_BUILDEREXT_PLUGGABLEFEATUREEXTENSION_HPP__ */
PluggableFeatureExtension()
Definition: PluggableFeatureExtension.hpp:124
Definition: PluggableFeatureExtension.hpp:112
virtual void setConfiguration(const openfluid::ware::WareParams_t &Config)
Definition: PluggableFeatureExtension.hpp:132
virtual ~PluggableFeatureExtension()
Definition: PluggableFeatureExtension.hpp:128
Definition: PluggableBuilderExtension.hpp:87
openfluid::fluidx::AdvancedFluidXDescriptor * mp_AdvancedDesc
Definition: PluggableFeatureExtension.hpp:117
Definition: ApplicationException.hpp:47
openfluid::ware::WareParams_t m_Config
Definition: PluggableFeatureExtension.hpp:119
void setFluidXDescriptor(openfluid::fluidx::AdvancedFluidXDescriptor *Desc)
Definition: PluggableFeatureExtension.hpp:136
#define OPENFLUID_API
Definition: dllexport.hpp:87
Definition: AdvancedFluidXDescriptor.hpp:51
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition: TypeDefs.hpp:130