
Go to the source code of this file.
Classes | |
| class | openfluid::base::PluggableFunction |
| Abstract class for plugin interface. More... | |
Namespaces | |
| namespace | openfluid |
| namespace | openfluid::base |
Defines | |
| #define | PLUGFUNCTION_PROC_NAME "GetPlugFunction" |
| #define | PLUGSIGNATURE_PROC_NAME "GetPlugSignature" |
| #define | PLUGSDKVERSION_PROC_NAME "GetPlugSDKVersion" |
| #define | DECLARE_PLUGIN_HOOKS |
| #define | DEFINE_FUNCTION_HOOK(pluginclassname) |
Typedefs | |
| typedef PluggableFunction *(* | openfluid::base::GetPluggableFunctionProc )() |
| typedef FunctionSignature *(* | openfluid::base::GetSignatureProc )() |
| typedef std::string(* | openfluid::base::GetSDKVersionProc )() |
Every simulation function must :
To be linked to an OpenFLUID application, the simulation function must have two hooks declarations.
extern "C" { DLLIMPORT PluggableFunction* GetPlugFunction(); DLLIMPORT PluggableFunction* GetPlugSignature(); };
returning the signature and an instance of the derived class inherited from the PluggableFunction class.
| #define DECLARE_PLUGIN_HOOKS |
extern "C" \ { \ DLLEXPORT std::string GetPlugSDKVersion(); \ DLLEXPORT openfluid::base::PluggableFunction* GetPlugFunction(); \ DLLEXPORT openfluid::base::FunctionSignature* GetPlugSignature(); \ }
Macro for declaration of function and signature hooks
| #define DEFINE_FUNCTION_HOOK | ( | pluginclassname | ) |
std::string GetPlugSDKVersion() \
{ \
return std::string(openfluid::config::FULL_VERSION); \
} \
\
openfluid::base::PluggableFunction* GetPlugFunction() \
{ \
return new pluginclassname(); \
}
Macro for definition of function hook
| [in] | pluginclassname | The name of the class to instanciate |
| #define PLUGFUNCTION_PROC_NAME "GetPlugFunction" |
Function hook name
| #define PLUGSDKVERSION_PROC_NAME "GetPlugSDKVersion" |
SDK version hook name
| #define PLUGSIGNATURE_PROC_NAME "GetPlugSignature" |
Signature hook name
Creative Commons By-NC-ND license