Classes | Namespaces | Defines | Typedefs
base/PlugFunction.hpp File Reference

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 )()

Detailed Description

Author:
Jean-Christophe FABRE <fabrejc@supagro.inra.fr>

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 Documentation

Value:
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)
Value:
std::string GetPlugSDKVersion() \
  { \
    return std::string(openfluid::config::FULL_VERSION); \
  } \
  \
  openfluid::base::PluggableFunction* GetPlugFunction() \
  { \
    return new pluginclassname(); \
  }

Macro for definition of function hook

Parameters:
[in]pluginclassnameThe 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


Generated using Doxygen 1.7.6.1
Creative Commons License Creative Commons By-NC-ND license