base/PlugFunction.hpp File Reference
Go to the source code of this file.
Detailed Description
- Author:
- Jean-Christophe FABRE <fabrejc@supagro.inra.fr>
Every simulation function must :
- define its own signature
- define a class inherited from the PluggableFunction class.
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
#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_GLOBAL_UNITS_ORDERED_LOOP |
( |
loopid, |
|
|
unit |
|
) |
|
Value:_M_##loopid##_GUList = mp_CoreData->getUnitsGlobally(); \
for (_M_##loopid##_ordit = _M_##loopid##_GUList->begin();_M_##loopid##_ordit != _M_##loopid##_GUList->end();++_M_##loopid##_ordit) \
{ \
unit = (*_M_##loopid##_ordit);
Macro for the beginning of a loop processing all units, following their process order
- Parameters:
-
[in] | loopid | ID of the loop, must match declaration |
[out] | unit | pointer to a openfluid::core::Unit objects, pointing to the current processed SU |
#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:
-
#define BEGIN_UNITS_ORDERED_LOOP |
( |
loopid, |
|
|
unitclass, |
|
|
unit |
|
) |
|
Value:if (!mp_CoreData->isUnitsClassExist(unitclass)) \
throw openfluid::base::OFException("OpenFLUID framework","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 |
Macro for declaration of a loop processing events in an event collection
#define DECLARE_GLOBAL_UNITS_ORDERED_LOOP |
( |
loopid |
|
) |
|
Value:Macro for declaration of a loop processing all units, following their process order
- Parameters:
-
[in] | loopid | ID of the loop |
#define DECLARE_PLUGIN_HOOKS |
Value:Macro for declaration of function and signature hooks
#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: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:Macro for definition of function hook
- Parameters:
-
[in] | pluginclassname | The name of the class to instanciate |
Macro for the ending of a loop
#define PLUGFUNCTION_PROC_NAME "GetPlugFunction" |
#define PLUGSDKVERSION_PROC_NAME "GetPlugSDKVersion" |
#define PLUGSIGNATURE_PROC_NAME "GetPlugSignature" |
#define STRINGIFY |
( |
x |
|
) |
XSTRINGIFY(x) |
#define XSTRINGIFY |
( |
x |
|
) |
#x |