base/PlugFunction.h File Reference

Header of generic pluggable function interface definition. More...


Classes

class  openfluid::base::PluggableFunction
 Abstract class for plugin interface. More...

Namespaces

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)
#define DECLARE_UNITS_ORDERED_LOOP(loopid)
#define BEGIN_UNITS_ORDERED_LOOP(loopid, unitclass, unit)
#define DECLARE_UNITS_LIST_LOOP(loopid)   openfluid::core::UnitsPtrList_t::iterator _M_##loopid##_lstit;\
#define BEGIN_UNITS_LIST_LOOP(loopid, ulist, unit)
#define DECLARE_EVENT_COLLECTION_LOOP   std::list<openfluid::core::DistributedEvent*>::iterator _M_EvListiter;
#define BEGIN_EVENT_COLLECTION_LOOP(evlist, evobj)
#define END_LOOP   }
#define DECLARE_SU_ORDERED_LOOP
#define DECLARE_SU_LIST_LOOP   openfluid::core::UnitList_t::iterator _M_SUListIter; \
#define BEGIN_SU_ORDERED_LOOP(suobj)
#define BEGIN_SU_LIST_LOOP(sulist, suobj)
#define DECLARE_RS_ORDERED_LOOP
#define DECLARE_RS_LIST_LOOP   std::list<openfluid::core::ReachSegment*>::iterator _M_RSListIter; \
#define BEGIN_RS_ORDERED_LOOP(rsobj)
#define BEGIN_RS_LIST_LOOP(rslist, rsobj)
#define DECLARE_GU_ORDERED_LOOP
#define DECLARE_GU_LIST_LOOP   std::list<openfluid::core::GroundwaterUnit*>::iterator _M_GUListIter; \
#define BEGIN_GU_ORDERED_LOOP(guobj)
#define BEGIN_GU_LIST_LOOP(gulist, guobj)


Detailed Description

Header of generic pluggable function interface definition.

Author:
Jean-Christophe FABRE <fabrejc@supagro.inra.fr>
Every simulation function must : To be linked to the OpenFLUID-engine kernel, 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

#define BEGIN_EVENT_COLLECTION_LOOP ( evlist,
evobj   ) 

Value:

for(_M_EvListiter=(evlist)->begin(); _M_EvListiter != (evlist)->end(); _M_EvListiter++) \
  { \
    evobj = *_M_EvListiter;
Macro for the beginning of a loop processing an event list from an event collection
Parameters:
[in] evlist pointer to a list of events
[out] evobj the current processed event

#define BEGIN_GU_LIST_LOOP ( gulist,
guobj   ) 

Value:

for(_M_GUListIter=gulist->begin(); _M_GUListIter != gulist->end(); _M_GUListIter++) \
  { \
    guobj = &(*_M_GUListIter); \
Macro for the begining of a loop processing a list of GUs
Parameters:
[out] gulist pointer to a list of openfluid::core::GroundwaterUnit
[out] guobj pointer to a openfluid::core::GroundwaterUnit object, pointing to the current processed GU
Deprecated:

#define BEGIN_GU_ORDERED_LOOP ( guobj   ) 

Value:

for(_M_GUsOrdIter=_M_GUsOrderedList->begin(); _M_GUsOrdIter != _M_GUsOrderedList->end(); _M_GUsOrdIter++) \
  { \
    guobj = &(*_M_GUsOrdIter); \
Macro for the begining of a loop processing GUs, following their process order
Parameters:
[out] guobj pointer to a openfluid::core::GroundwaterUnit object, pointing to the current processed GU
Deprecated:

#define BEGIN_RS_LIST_LOOP ( rslist,
rsobj   ) 

Value:

for(_M_RSListIter=rslist->begin(); _M_RSListIter != rslist->end(); _M_RSListIter++) \
  { \
    rsobj = &(*_M_RSListIter); \
Macro for the begining of a loop processing a list of RSs
Parameters:
[out] rslist pointer to a list of openfluid::core::ReachSegment
[out] rsobj pointer to a openfluid::core::ReachSegment object, pointing to the current processed RS
Deprecated:

#define BEGIN_RS_ORDERED_LOOP ( rsobj   ) 

Value:

for(_M_RSsOrdIter=_M_RSsOrderedList->begin(); _M_RSsOrdIter != _M_RSsOrderedList->end(); _M_RSsOrdIter++) \
  { \
    rsobj = &(*_M_RSsOrdIter); \
Macro for the begining of a loop processing RSs, following their process order
Parameters:
[out] rsobj pointer to a openfluid::core::ReachSegment object, pointing to the current processed RS
Deprecated:

#define BEGIN_SU_LIST_LOOP ( sulist,
suobj   ) 

Value:

for(_M_SUListIter=sulist->begin(); _M_SUListIter != sulist->end(); _M_SUListIter++) \
  { \
    suobj = &(*_M_SUListIter); \
Macro for the begining of a loop processing a list of SUs
Parameters:
[out] sulist pointer to a list of openfluid::core::SurfaceUnit
[out] suobj pointer to a openfluid::core::SurfaceUnit object, pointing to the current processed SU
Deprecated:

#define BEGIN_SU_ORDERED_LOOP ( suobj   ) 

Value:

for(_M_SUsOrdIter=_M_SUsOrderedList->begin(); _M_SUsOrdIter != _M_SUsOrderedList->end(); _M_SUsOrdIter++) \
  { \
    suobj = &(*_M_SUsOrdIter); \
Macro for the begining of a loop processing SUs, following their process order
Parameters:
[out] suobj pointer to a openfluid::core::SurfaceUnit object, pointing to the current processed SU
Deprecated:

#define BEGIN_UNITS_LIST_LOOP ( loopid,
ulist,
unit   ) 

Value:

for(_M_##loopid##_lstit=ulist->begin(); _M_##loopid##_lstit != ulist->end(); _M_##loopid##_lstit++) \
  { \
    unit = *_M_##loopid##_lstit; \
Macro for the beginning of a loop processing a list of units
Parameters:
[in] loopid ID of the loop, must match declaration
[in] ulist pointer to a list of openfluid::core::Unit
[out] unit pointer to a openfluid::core::Unit objects, pointing to the current processed SU

#define BEGIN_UNITS_ORDERED_LOOP ( loopid,
unitclass,
unit   ) 

Value:

if (!mp_CoreData->isUnitsClassExist(unitclass)) \
    throw openfluid::base::OFException("ofelib","BEGIN_UNITS_ORDERED_LOOP","Unit class " + std::string(unitclass) + " does not exists"); \
  _M_##loopid##_UList = mp_CoreData->getUnits(unitclass)->getList(); \
  for (_M_##loopid##_ordit = _M_##loopid##_UList->begin();_M_##loopid##_ordit != _M_##loopid##_UList->end();++_M_##loopid##_ordit) \
  { \
    unit = &(*_M_##loopid##_ordit);
Macro for the beginning of a loop processing all units of a class, following their process order
Parameters:
[in] loopid ID of the loop, must match declaration
[in] unitclass name of the unit class
[out] unit pointer to a openfluid::core::Unit objects, pointing to the current processed SU

#define DECLARE_EVENT_COLLECTION_LOOP   std::list<openfluid::core::DistributedEvent*>::iterator _M_EvListiter;

Macro for declaration of a loop processing events in an event collection

#define DECLARE_GU_LIST_LOOP   std::list<openfluid::core::GroundwaterUnit*>::iterator _M_GUListIter; \

Macro for declaration of a loop processing a list of GUs

Deprecated:

#define DECLARE_GU_ORDERED_LOOP

Value:

openfluid::core::UnitsList_t::iterator _M_GUsOrdIter; \
  openfluid::core::UnitsList_t* _M_GUsOrderedList = mp_CoreData->getUnits("GU")->getList();
Macro for declaration of a loop processing GUs, following their process order
Deprecated:

#define DECLARE_PLUGIN_HOOKS

Value:

extern "C" \
  { \
    DLLIMPORT std::string GetPlugSDKVersion(); \
    DLLIMPORT openfluid::base::PluggableFunction* GetPlugFunction(); \
    DLLIMPORT openfluid::base::FunctionSignature* GetPlugSignature(); \
  }
Macro for declaration of function and signature hooks

#define DECLARE_RS_LIST_LOOP   std::list<openfluid::core::ReachSegment*>::iterator _M_RSListIter; \

Macro for declaration of a loop processing a list of RSs

Deprecated:

#define DECLARE_RS_ORDERED_LOOP

Value:

openfluid::core::UnitsList_t::iterator _M_RSsOrdIter; \
  openfluid::core::UnitsList_t* _M_RSsOrderedList = mp_CoreData->getUnits("RS")->getList();
Macro for declaration of a loop processing RSs, following their process order
Deprecated:

#define DECLARE_SU_LIST_LOOP   openfluid::core::UnitList_t::iterator _M_SUListIter; \

Macro for declaration of a loop processing a list of SUs

Deprecated:

#define DECLARE_SU_ORDERED_LOOP

Value:

openfluid::core::UnitsList_t::iterator _M_SUsOrdIter; \
  openfluid::core::UnitsList_t* _M_SUsOrderedList = mp_CoreData->getUnits("SU")->getList();
Macro for declaration of a loop processing SUs, following their process order
Deprecated:

#define DECLARE_UNITS_LIST_LOOP ( loopid   )     openfluid::core::UnitsPtrList_t::iterator _M_##loopid##_lstit;\

Macro for declaration of a loop processing a list of units

Parameters:
[in] loopid ID of the loop

#define DECLARE_UNITS_ORDERED_LOOP ( loopid   ) 

Value:

openfluid::core::UnitsList_t::iterator _M_##loopid##_ordit;\
  openfluid::core::UnitsList_t* _M_##loopid##_UList;
Macro for declaration of a loop processing all units of a class, following their process order
Parameters:
[in] loopid ID of the loop

#define DEFINE_FUNCTION_HOOK ( pluginclassname   ) 

Value:

std::string GetPlugSDKVersion() \
  { \
    return std::string(STRINGIFY(OFELIB_VERSION)); \
  } \
  \
  openfluid::base::PluggableFunction* GetPlugFunction() \
  { \
    return new pluginclassname(); \
  }
Macro for definition of function hook
Parameters:
[in] pluginclassname The name of the class to instanciate

#define END_LOOP   }

Macro for the ending of a loop

#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.5.8
Creative Commons License Creative Commons By-NC-ND license