Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5137 in orxonox.OLD for trunk/src/util/loading


Ignore:
Timestamp:
Aug 26, 2005, 1:41:54 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better macro-definition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/loading/load_param.h

    r5135 r5137  
    6262**** MACROS DEFINITIONS OF LOADABLES *****
    6363*****************************************/
     64// 0. TYPES
     65/**
     66 *  a Macro to easily implement many different Constructors for the LoadParam-Class with no argument
     67 */
     68#define LoadParam0() \
     69LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(), bool multi = false) \
     70  : BaseLoadParam(root, pt2Object, paramName, 0, multi, NULL, "") \
     71{ \
     72  if (loadString != NULL && root != NULL) \
     73    (*pt2Object.*function)(); \
     74  else \
     75    PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName());\
     76}
     77
    6478// 1. TYPE
    6579/**
     
    287301template<class T> class LoadParam : public BaseLoadParam
    288302{
    289  public:
    290   LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(), bool multi = false)
    291     : BaseLoadParam(root, pt2Object, paramName, 0, multi, NULL, "")
    292     {
    293       if (loadString != NULL && root != NULL)
    294         (*pt2Object.*function)();
    295       else
    296         PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName());
    297     }
    298 
     303  public:
    299304
    300305#define FUNCTOR_LIST(x)    LoadParam ## x
Note: See TracChangeset for help on using the changeset viewer.