Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4299 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
May 26, 2005, 3:07:59 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: loadString is now loaded not by the template but by the baseclass

Location:
orxonox/trunk/src/util/loading
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/loading/load_param.cc

    r4285 r4299  
    2727   \param ... the parameter information
    2828*/
    29 BaseLoadParam::BaseLoadParam(BaseObject* object, const char* paramName, int paramCount, ...)
    30 {
     29BaseLoadParam::BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName, int paramCount, ...)
     30{
     31  this->loadString = grabParameter(root, paramName);
     32
    3133  this->paramDesc = NULL;
    3234  if (LoadClassDescription::parametersDescription)
     
    4749          strcpy(this->paramDesc->types[i], tmpTypeName);
    4850        }
    49       va_end(types); 
     51      va_end(types);
    5052
    5153      int argCount = 0;
  • orxonox/trunk/src/util/loading/load_param.h

    r4261 r4299  
    6565#define LoadParam1(type1) \
    6666 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE)) \
    67   : BaseLoadParam(pt2Object, paramName, 1, type1##_NAME) \
    68     { \
    69       const char* loadString = grabParameter(root, paramName); \
     67   : BaseLoadParam(root, pt2Object, paramName, 1, type1##_NAME)         \
     68    { \
    7069      if (loadString != NULL && root != NULL) \
    7170        (*pt2Object.*function)(type1##_FUNC(loadString)); \
     
    7877#define LoadParam2(type1, type2) \
    7978 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE)) \
    80   : BaseLoadParam(pt2Object, paramName, 2, type1##_NAME, type2##_NAME) \
    81     { \
    82       const char* loadString = grabParameter(root, paramName); \
     79   : BaseLoadParam(root, pt2Object, paramName, 2, type1##_NAME, type2##_NAME) \
     80    { \
    8381      if (loadString != NULL && root != NULL) \
    8482        { \
     
    9896#define LoadParam3(type1, type2, type3) \
    9997 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE))\
    100   : BaseLoadParam(pt2Object, paramName, 3, type1##_NAME, type2##_NAME, type3##_NAME) \
    101     { \
    102       const char* loadString = grabParameter(root, paramName); \
     98   : BaseLoadParam(root, pt2Object, paramName, 3, type1##_NAME, type2##_NAME, type3##_NAME) \
     99    { \
    103100      if (loadString != NULL && root != NULL) \
    104101        { \
     
    118115#define LoadParam4(type1, type2, type3, type4) \
    119116 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE)) \
    120   : BaseLoadParam(pt2Object, paramName, 4, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \
    121     { \
    122       const char* loadString = grabParameter(root, paramName); \
     117   : BaseLoadParam(root, pt2Object, paramName, 4, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \
     118    { \
    123119      if (loadString != NULL && root != NULL) \
    124120        { \
     
    138134#define LoadParam5(type1, type2, type3, type4, type5) \
    139135 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE, type5##_TYPE)) \
    140   : BaseLoadParam(pt2Object, paramName, 5, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \
    141     { \
    142       const char* loadString = grabParameter(root, paramName); \
     136   : BaseLoadParam(root, pt2Object, paramName, 5, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \
     137    { \
    143138      if (loadString != NULL && root != NULL) \
    144139        { \
     
    202197
    203198 protected:
    204   BaseLoadParam(BaseObject* object, const char* paramName, int paramCount, ...);
     199  BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName, int paramCount, ...);
    205200
    206201 protected:
    207202  LoadClassDescription* classDesc;               //!< The LoadClassDescription of this LoadParameter
    208203  LoadParamDescription* paramDesc;               //!< The LoadParameterDescription of this LoadParameter
     204  const char* loadString;                        //!< The string loaded by this LoadParam
    209205};
    210206
Note: See TracChangeset for help on using the changeset viewer.