Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 21, 2005, 11:17:18 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/levelLoader: some issues, to be able to describe what is loadable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelLoader/src/util/loading/load_param.h

    r4250 r4251  
    2525#include "debug.h"
    2626#include "substring.h"
     27
     28// Forward Declaration //
     29template<class T> class tList;
    2730
    2831/**
     
    3740#define l_INT_TYPE int
    3841#define l_INT_FUNC atoi
     42#define l_INT_NAME "int"
    3943
    4044#define l_LONG_TYPE long
    4145#define l_LONG_FUNC atol
     46#define l_LONG_NAME "long"
    4247
    4348#define l_SHORT_TYPE short
    4449#define l_SHORT_FUNC atoi
     50#define l_SHORT_NAME "short"
    4551
    4652#define l_FLOAT_TYPE float
    4753#define l_FLOAT_FUNC atof
     54#define l_FLOAT_NAME "float"
    4855
    4956#define l_STRING_TYPE const char*
    50 #define l_STRING_FUNC
     57#define l_STRING_FUNC
     58#define l_STRING_NAME "string"
    5159
    5260
     
    5765#define LoadParam1(type1) \
    5866 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE)) \
     67  : BaseLoadParam(pt2Object, type1##_NAME) \
    5968    { \
    6069      const char* loadString = grabParameter(root, paramName); \
     
    6271        (*pt2Object.*function)(type1##_FUNC(loadString)); \
    6372      else \
    64         PRINTF(2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
     73        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
    6574    }
    6675
     
    6978#define LoadParam2(type1, type2) \
    7079 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE)) \
     80  : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME) \
    7181    { \
    7282      const char* loadString = grabParameter(root, paramName); \
     
    8191        } \
    8292      else \
    83         PRINTF(2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
    84     };
     93        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
     94    }
    8595
    8696
    8797// 3. TYPES
    8898#define LoadParam3(type1, type2, type3) \
    89  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE)) \
     99 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE))\
     100  : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME) \
    90101    { \
    91102      const char* loadString = grabParameter(root, paramName); \
     
    100111        } \
    101112      else \
    102         PRINTF(2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
    103     };
     113        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
     114    }
    104115
    105116
     
    107118#define LoadParam4(type1, type2, type3, type4) \
    108119 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE)) \
     120  : BaseLoadParam(pt2Object, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME) \
    109121    { \
    110122      const char* loadString = grabParameter(root, paramName); \
     
    119131        } \
    120132      else \
    121         PRINTF(2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
    122     };
     133        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
     134    }
    123135
    124136
     
    126138#define LoadParam5(type1, type2, type3, type4, type5) \
    127139 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, type1##_NAME, type2##_NAME, type3##_NAME, type2##_NAME, type4##_NAME, type5##_NAME) \
    128141    { \
    129142      const char* loadString = grabParameter(root, paramName); \
     
    138151        } \
    139152      else \
    140         PRINTF(2)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
    141     };
     153        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
     154    }
     155
    142156
    143157
     
    147161  int paramCount;
    148162  char** types;
     163  const char* className;
     164
     165};
     166
     167class LoadClassDescription
     168{
     169 public:
     170
     171
     172  static bool ParametersDescription;
     173 
     174 private:
     175  tList<LoadParamDescription>* paramList;
    149176};
    150177
     
    152179class BaseLoadParam
    153180{
    154  public:
     181 protected:
     182  BaseLoadParam(BaseObject* object, const char* type1 = NULL, const char* type2 = NULL,
     183                const char* type3 = NULL, const char* type4 = NULL, const char* type5 = NULL);
     184
     185 protected:
     186  LoadParamDescription* description;
    155187};
    156188
Note: See TracChangeset for help on using the changeset viewer.