Defines
base/LoopMacros.hpp File Reference

Header of ... More...

Go to the source code of this file.

Defines

#define DECLARE_UNITS_ORDERED_LOOP(loopid)
#define DECLARE_GLOBAL_UNITS_ORDERED_LOOP(loopid)
#define BEGIN_UNITS_ORDERED_LOOP(loopid, unitclass, unit)
#define BEGIN_GLOBAL_UNITS_ORDERED_LOOP(loopid, 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   openfluid::core::EventsList_t::iterator _M_EvListiter;
#define BEGIN_EVENT_COLLECTION_LOOP(evlist, evobj)
#define END_LOOP
#define _UNITID(_id)   _M_##_id##_Unit
#define _UNITSLISTID(_id)   _M_##_id##_UList
#define _UNITSPTRLISTID(_id)   _M_##_id##_UList
#define _THREADPOOLID(_id)   _M_##_id##_Pool
#define _PCSORDID(_id)   _M_##_id##_PcsOrd
#define _UNITSLISTITERID(_id)   _M_##_id##_UListit
#define _UNITSPTRLISTITERID(_id)   _M_##_id##_UPtrListit
#define _EVENTSLISTITERID(_id)   _M_##_id##_EListit
#define _OPENFLUID_UNITS_ORDERED_LOOP_WITHID(unitclass, unitptr, id)
#define OPENFLUID_UNITS_ORDERED_LOOP(unitclass, unitptr)   _OPENFLUID_UNITS_ORDERED_LOOP_WITHID(unitclass,unitptr,__LINE__)
#define _APPLY_UNITS_ORDERED_LOOP_THREADED_WITHID(id, unitclass, funcptr,...)
#define APPLY_UNITS_ORDERED_LOOP_THREADED(unitclass, funcptr,...)   _APPLY_UNITS_ORDERED_LOOP_THREADED_WITHID(__LINE__,unitclass,funcptr,## __VA_ARGS__)
#define _OPENFLUID_ALLUNITS_ORDERED_LOOP_WITHID(unitptr, id)
#define OPENFLUID_ALLUNITS_ORDERED_LOOP(unitptr)   _OPENFLUID_ALLUNITS_ORDERED_LOOP_WITHID(unitptr,__LINE__)
#define _APPLY_ALLUNITS_ORDERED_LOOP_THREADED_WITHID(id, funcptr,...)
#define APPLY_ALLUNITS_ORDERED_LOOP_THREADED(funcptr,...)   _APPLY_ALLUNITS_ORDERED_LOOP_THREADED_WITHID(__LINE__,funcptr,## __VA_ARGS__)
#define _OPENFLUID_UNITSLIST_LOOP_WITHID(unitslist, unitptr, id)
#define OPENFLUID_UNITSLIST_LOOP(unitslist, unitptr)   _OPENFLUID_UNITSLIST_LOOP_WITHID(unitslist,unitptr,__LINE__)
#define _OPENFLUID_EVENT_COLLECTION_LOOP_WITHID(id, evlist, evobj)
#define OPENFLUID_EVENT_COLLECTION_LOOP(evlist, evobj)   _OPENFLUID_EVENT_COLLECTION_LOOP_WITHID(__LINE__,evlist,evobj)

Detailed Description

Header of ...

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

Define Documentation

#define _APPLY_ALLUNITS_ORDERED_LOOP_THREADED_WITHID (   id,
  funcptr,
  ... 
)
Value:
openfluid::core::UnitsPtrList_t* _UNITSPTRLISTID(id) = mp_CoreData->getUnitsGlobally(); \
  if (_UNITSPTRLISTID(id) != NULL) \
  { \
    openfluid::core::UnitsPtrList_t::iterator _UNITSPTRLISTITERID(id) = _UNITSPTRLISTID(id)->begin(); \
    if (_UNITSPTRLISTITERID(id) != _UNITSPTRLISTID(id)->end()) \
    { \
      openfluid::core::PcsOrd_t _PCSORDID(id) = (*_UNITSPTRLISTITERID(id))->getProcessOrder(); \
      while (_UNITSPTRLISTITERID(id) != _UNITSPTRLISTID(id)->end()) \
      { \
        Glib::ThreadPool _THREADPOOLID(id)(OPENFLUID_GetFunctionMaxThreads(),true); \
        while (_UNITSPTRLISTITERID(id) != _UNITSPTRLISTID(id)->end() && (*_UNITSPTRLISTITERID(id))->getProcessOrder() == _PCSORDID(id)) \
        { \
          _THREADPOOLID(id).push(sigc::bind(sigc::mem_fun(*this,&funcptr),(*_UNITSPTRLISTITERID(id)), ## __VA_ARGS__)); \
          ++_UNITSPTRLISTITERID(id); \
        } \
        _THREADPOOLID(id).shutdown(); \
        if (_UNITSPTRLISTITERID(id) != _UNITSPTRLISTID(id)->end()) _PCSORDID(id) = (*_UNITSPTRLISTITERID(id))->getProcessOrder(); \
      } \
    } \
  }
#define _APPLY_UNITS_ORDERED_LOOP_THREADED_WITHID (   id,
  unitclass,
  funcptr,
  ... 
)
Value:
openfluid::core::UnitsList_t* _UNITSLISTID(id) = mp_CoreData->getUnits(unitclass)->getList(); \
  if (_UNITSLISTID(id) != NULL) \
  { \
    openfluid::core::UnitsList_t::iterator _UNITSLISTITERID(id) = _UNITSLISTID(id)->begin(); \
    if (_UNITSLISTITERID(id) != _UNITSLISTID(id)->end()) \
    { \
      openfluid::core::PcsOrd_t _PCSORDID(id) = _UNITSLISTITERID(id)->getProcessOrder(); \
      while (_UNITSLISTITERID(id) != _UNITSLISTID(id)->end()) \
      { \
        Glib::ThreadPool _THREADPOOLID(id)(OPENFLUID_GetFunctionMaxThreads(),true); \
        while (_UNITSLISTITERID(id) != _UNITSLISTID(id)->end() && _UNITSLISTITERID(id)->getProcessOrder() == _PCSORDID(id)) \
        { \
          _THREADPOOLID(id).push(sigc::bind(sigc::mem_fun(*this,&funcptr),&(*_UNITSLISTITERID(id)), ## __VA_ARGS__)); \
          ++_UNITSLISTITERID(id); \
        } \
        _THREADPOOLID(id).shutdown(); \
        if (_UNITSLISTITERID(id) != _UNITSLISTID(id)->end()) _PCSORDID(id) = _UNITSLISTITERID(id)->getProcessOrder(); \
      } \
    } \
  }
#define _EVENTSLISTITERID (   _id)    _M_##_id##_EListit
#define _OPENFLUID_ALLUNITS_ORDERED_LOOP_WITHID (   unitptr,
  id 
)
Value:
openfluid::core::UnitsPtrList_t* _UNITSPTRLISTID(id) = mp_CoreData->getUnitsGlobally(); \
    for (openfluid::core::UnitsPtrList_t::iterator _UNITSPTRLISTITERID(id) = _UNITSPTRLISTID(id)->begin(); \
         unitptr = (*_UNITSPTRLISTITERID(id)),_UNITSPTRLISTITERID(id) != _UNITSPTRLISTID(id)->end(); \
         ++_UNITSPTRLISTITERID(id))
#define _OPENFLUID_EVENT_COLLECTION_LOOP_WITHID (   id,
  evlist,
  evobj 
)
Value:
for(openfluid::core::EventsList_t::iterator _EVENTSLISTITERID(id) = (evlist)->begin(); \
        evobj = &(*_EVENTSLISTITERID(id)), _EVENTSLISTITERID(id) != (evlist)->end(); \
       ++_EVENTSLISTITERID(id))
#define _OPENFLUID_UNITS_ORDERED_LOOP_WITHID (   unitclass,
  unitptr,
  id 
)
Value:
openfluid::core::UnitsList_t* _UNITSLISTID(id) = mp_CoreData->getUnits(unitclass)->getList(); \
    if (_UNITSLISTID(id) != 0) \
      for (openfluid::core::UnitsList_t::iterator _UNITSLISTITERID(id) = _UNITSLISTID(id)->begin(); \
           unitptr = &(*_UNITSLISTITERID(id)),_UNITSLISTITERID(id) != _UNITSLISTID(id)->end(); \
           ++_UNITSLISTITERID(id))
#define _OPENFLUID_UNITSLIST_LOOP_WITHID (   unitslist,
  unitptr,
  id 
)
Value:
if (unitslist != 0) \
      for (openfluid::core::UnitsPtrList_t::iterator _UNITSLISTITERID(id) = unitslist->begin(); \
           unitptr = *_UNITSLISTITERID(id),_UNITSLISTITERID(id) != unitslist->end(); \
           ++_UNITSLISTITERID(id))
#define _PCSORDID (   _id)    _M_##_id##_PcsOrd
#define _THREADPOOLID (   _id)    _M_##_id##_Pool
#define _UNITID (   _id)    _M_##_id##_Unit
#define _UNITSLISTID (   _id)    _M_##_id##_UList
#define _UNITSLISTITERID (   _id)    _M_##_id##_UListit
#define _UNITSPTRLISTID (   _id)    _M_##_id##_UList
#define _UNITSPTRLISTITERID (   _id)    _M_##_id##_UPtrListit
#define APPLY_ALLUNITS_ORDERED_LOOP_THREADED (   funcptr,
  ... 
)    _APPLY_ALLUNITS_ORDERED_LOOP_THREADED_WITHID(__LINE__,funcptr,## __VA_ARGS__)

Macro for applying a threaded function to each unit of the domain, following their process order

Parameters:
[in]funcptrmember function name
[in]...extra parameters to pass to the member function
#define APPLY_UNITS_ORDERED_LOOP_THREADED (   unitclass,
  funcptr,
  ... 
)    _APPLY_UNITS_ORDERED_LOOP_THREADED_WITHID(__LINE__,unitclass,funcptr,## __VA_ARGS__)

Macro for applying a threaded function to each unit of a class, following their process order

Parameters:
[in]unitclassname of the unit class
[in]funcptrmember function name
[in]...extra parameters to pass to the member function
#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]evlistpointer to a list of events
[out]evobjthe current processed event
Deprecated:
#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]loopidID of the loop, must match declaration
[out]unitpointer to a openfluid::core::Unit objects, pointing to the current processed SU
Deprecated:
#define BEGIN_UNITS_LIST_LOOP (   loopid,
  ulist,
  unit 
)
Value:
if ((ulist) != NULL) \
  { \
    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]loopidID of the loop, must match declaration
[in]ulistpointer to a list of openfluid::core::Unit
[out]unitpointer to a openfluid::core::Unit objects, pointing to the current processed SU
Deprecated:
#define BEGIN_UNITS_ORDERED_LOOP (   loopid,
  unitclass,
  unit 
)
Value:
_M_##loopid##_UList = mp_CoreData->getUnits(unitclass)->getList(); \
  if (_M_##loopid##_UList != NULL) \
    { \
    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]loopidID of the loop, must match declaration
[in]unitclassname of the unit class
[out]unitpointer to a openfluid::core::Unit objects, pointing to the current processed SU
Deprecated:
#define DECLARE_EVENT_COLLECTION_LOOP   openfluid::core::EventsList_t::iterator _M_EvListiter;

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

Deprecated:
#define DECLARE_GLOBAL_UNITS_ORDERED_LOOP (   loopid)
Value:
openfluid::core::UnitsPtrList_t::iterator _M_##loopid##_ordit;\
  openfluid::core::UnitsPtrList_t* _M_##loopid##_GUList;

Macro for declaration of a loop processing all units, following their process order

Parameters:
[in]loopidID of the loop
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]loopidID of the loop
Deprecated:
#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]loopidID of the loop
Deprecated:
#define END_LOOP
Value:
} \
  }

Macro for the ending of a loop

Deprecated:
#define OPENFLUID_ALLUNITS_ORDERED_LOOP (   unitptr)    _OPENFLUID_ALLUNITS_ORDERED_LOOP_WITHID(unitptr,__LINE__)

Macro for a loop processing all units, following their process order

Parameters:
[out]unitptrpointer to a openfluid::core::Unit objects, automatically pointing to the current processed unit
#define OPENFLUID_EVENT_COLLECTION_LOOP (   evlist,
  evobj 
)    _OPENFLUID_EVENT_COLLECTION_LOOP_WITHID(__LINE__,evlist,evobj)

Macro for a loop processing an events list from an event collection

Parameters:
[in]evlistpointer to a list of events
[out]evobjthe current processed event
#define OPENFLUID_UNITS_ORDERED_LOOP (   unitclass,
  unitptr 
)    _OPENFLUID_UNITS_ORDERED_LOOP_WITHID(unitclass,unitptr,__LINE__)

Macro for a loop processing all units of a class, following their process order

Parameters:
[in]unitclassname of the unit class
[out]unitptrpointer to a openfluid::core::Unit objects, automatically pointing to the current processed unit
#define OPENFLUID_UNITSLIST_LOOP (   unitslist,
  unitptr 
)    _OPENFLUID_UNITSLIST_LOOP_WITHID(unitslist,unitptr,__LINE__)

Macro for a loop processing a list of units

Parameters:
[in]unitslistpointer to a list of openfluid::core::Unit
[out]unitptrpointer to a openfluid::core::Unit objects, pointing to the current processed unit

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