Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4487 in orxonox.OLD for orxonox/trunk/src/util/loading/load_param.h


Ignore:
Timestamp:
Jun 3, 2005, 12:56:57 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more doxygen-tags in util

File:
1 edited

Legend:

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

    r4318 r4487  
    3838*/
    3939
    40 #define l_INT_TYPE int
    41 #define l_INT_FUNC atoi
    42 #define l_INT_NAME "int"
    43 
    44 #define l_LONG_TYPE long
    45 #define l_LONG_FUNC atol
    46 #define l_LONG_NAME "long"
    47 
    48 #define l_SHORT_TYPE short
    49 #define l_SHORT_FUNC atoi
    50 #define l_SHORT_NAME "short"
    51 
    52 #define l_FLOAT_TYPE float
    53 #define l_FLOAT_FUNC atof
    54 #define l_FLOAT_NAME "float"
    55 
    56 #define l_STRING_TYPE const char*
    57 #define l_STRING_FUNC
    58 #define l_STRING_NAME "string"
    59 
    60 
    61 /**
    62    \brief a Macro to easily implement many different Constructors for the LoadParam-Class
     40#define l_INT_TYPE       int              //!< The type of an INT
     41#define l_INT_FUNC       atoi             //!< the function to call to parse INT
     42#define l_INT_NAME       "int"            //!< the name of an INT
     43
     44#define l_LONG_TYPE      long             //!< The type of a LONG
     45#define l_LONG_FUNC      atol             //!< The function to parse a LONG
     46#define l_LONG_NAME      "long"           //!< The name of a LONG
     47
     48#define l_SHORT_TYPE     short            //!< The type of a SHORT
     49#define l_SHORT_FUNC     atoi             //!< The function to parse a SHORT
     50#define l_SHORT_NAME     "short"          //!< The name of a SHORT
     51
     52#define l_FLOAT_TYPE     float            //!< The type of a FLOAT
     53#define l_FLOAT_FUNC     atof             //!< The function to parse a FLOAT
     54#define l_FLOAT_NAME     "float"          //!< The name of a FLOAT
     55
     56#define l_STRING_TYPE    const char*      //!< The type fo a STRING
     57#define l_STRING_FUNC                     //!< The function to parse a STRING
     58#define l_STRING_NAME    "string"         //!< The name of a STRING
     59
     60// 1. TYPE
     61/**
     62   \brief a Macro to easily implement many different Constructors for the LoadParam-Class with 1 argument
    6363   \param type1 The type of the first functionParameter
    6464*/
     
    7575
    7676// 2. TYPES
     77/**
     78   \brief a Macro to easily implement many different Constructors for the LoadParam-Class with 2 arguments
     79   \param type1 The type of the first functionParameter
     80   \param type2 The type of the second functionParameter
     81*/
    7782#define LoadParam2(type1, type2) \
    7883 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE)) \
     
    9499
    95100// 3. TYPES
     101/**
     102   \brief a Macro to easily implement many different Constructors for the LoadParam-Class with 3 arguments
     103   \param type1 The type of the first functionParameter
     104   \param type2 The type of the second functionParameter
     105   \param type3 The type of the third functionParameter
     106*/
    96107#define LoadParam3(type1, type2, type3) \
    97108 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE))\
     
    113124
    114125// 4. TYPES
     126/**
     127   \brief a Macro to easily implement many different Constructors for the LoadParam-Class with 4 arguments
     128   \param type1 The type of the first functionParameter
     129   \param type2 The type of the second functionParameter
     130   \param type3 The type of the third functionParameter
     131   \param type4 The type of the forth functionParameter
     132*/
    115133#define LoadParam4(type1, type2, type3, type4) \
    116134 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE)) \
     
    132150
    133151// 5. TYPES
     152/**
     153   \brief a Macro to easily implement many different Constructors for the LoadParam-Class with 5 arguments
     154   \param type1 The type of the first functionParameter
     155   \param type2 The type of the second functionParameter
     156   \param type3 The type of the third functionParameter
     157   \param type4 The type of the forth functionParameter
     158   \param type5 The type of the fifth functionParameter
     159*/
    134160#define LoadParam5(type1, type2, type3, type4, type5) \
    135161 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE, type5##_TYPE)) \
     
    161187  void setDescription(const char* descriptionText);
    162188  /** \returns the descriptionString */
    163   const char* getDescription(void) { return this->description;};
     189  const char* getDescription(void) { return this->description; };
    164190
    165191  void print(void) const;
    166192 private:
    167   char* paramName;              //!< The name of the parameter
    168   int paramCount;               //!< The count of parameters
    169   char** types;                 //!< What kind of parameters does this function take ??
    170   char* description;            //!< A longer description about this function
    171 };
    172 
     193  char*         paramName;             //!< The name of the parameter
     194  int           paramCount;            //!< The count of parameters
     195  char**        types;                 //!< What kind of parameters does this function take ??
     196  char*         description;           //!< A longer description about this function
     197};
     198
     199//! A class for descriptions of a loadable module
    173200class LoadClassDescription
    174201{
     
    184211  static void printAll(const char* fileName = NULL);
    185212
    186   static bool parametersDescription;             //!< if parameter-description should be enabled.
    187   static tList<LoadClassDescription>* classList; //!< a list, that holds all the loadable classes. (after one instance has been loaded)
    188213 private:
    189   char* className;                               //!< name of the class
    190   tList<LoadParamDescription>* paramList;        //!< List of parameters this class knows.
    191 };
    192 
    193 // abstract Base class
     214  static bool                         parametersDescription;  //!< if parameter-description should be enabled.
     215  static tList<LoadClassDescription>* classList;              //!< a list, that holds all the loadable classes. (after one instance has been loaded)
     216  char*                               className;              //!< name of the class
     217  tList<LoadParamDescription>*        paramList;              //!< List of parameters this class knows.
     218};
     219
     220//! abstract Base class for a Loadable parameter
    194221class BaseLoadParam
    195222{
     
    201228
    202229 protected:
    203   LoadClassDescription* classDesc;               //!< The LoadClassDescription of this LoadParameter
    204   LoadParamDescription* paramDesc;               //!< The LoadParameterDescription of this LoadParameter
    205   const char* loadString;                        //!< The string loaded by this LoadParam
     230  LoadClassDescription*    classDesc;            //!< The LoadClassDescription of this LoadParameter
     231  LoadParamDescription*    paramDesc;            //!< The LoadParameterDescription of this LoadParameter
     232  const char*              loadString;           //!< The string loaded by this LoadParam
    206233};
    207234
     
    211238{
    212239 public:
     240  //! makes functions with one string loadable
    213241  LoadParam1(l_STRING);
     242  //! makes functions with two strings loadable
    214243  LoadParam2(l_STRING, l_STRING);
     244  //! makes functions with three strings loadable
    215245  LoadParam3(l_STRING, l_STRING, l_STRING);
     246  //! makes functions with four strings loadable
    216247  LoadParam4(l_STRING, l_STRING, l_STRING, l_STRING);
    217248
     249  //! makes functions with one int loadable
    218250  LoadParam1(l_INT);
     251  //! makes functions with two ints loadable
    219252  LoadParam2(l_INT, l_INT);
     253  //! makes functions with three ints loadable
    220254  LoadParam3(l_INT, l_INT, l_INT);
     255  //! makes functions with four ints loadable
    221256  LoadParam4(l_INT, l_INT, l_INT, l_INT);
    222257
     258  //! makes functions with one float loadable
    223259  LoadParam1(l_FLOAT);
     260  //! makes functions with two floats loadable
    224261  LoadParam2(l_FLOAT, l_FLOAT);
     262  //! makes functions with three floats loadable
    225263  LoadParam3(l_FLOAT, l_FLOAT, l_FLOAT);
     264  //! makes functions with four floats loadable
    226265  LoadParam4(l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT);
    227266};
Note: See TracChangeset for help on using the changeset viewer.