Index: trunk/src/util/loading/load_param.cc
===================================================================
--- trunk/src/util/loading/load_param.cc	(revision 5301)
+++ trunk/src/util/loading/load_param.cc	(revision 5332)
@@ -13,4 +13,6 @@
    co-programmer: ...
 */
+
+#include "functor_list.h"
 
 #include "load_param.h"
@@ -64,5 +66,5 @@
 
       this->paramDesc->paramCount = paramCount;
-      this->paramDesc->types = new char*[paramCount];
+      this->paramDesc->types = new int[paramCount];
       this->paramDesc->defaultValues = new char*[paramCount];
 
@@ -73,33 +75,25 @@
       {
           // parameters parsed
-        const char* tmpTypeName = va_arg (types, const char*);
-        this->paramDesc->types[i] = new char[strlen(tmpTypeName)+1];
-        strcpy(this->paramDesc->types[i], tmpTypeName);
-
-        //! @todo SWITCH CASE WITH l_[TYPE]_TYPE -> much faster
-          // default value description
-        if (!strcmp(tmpTypeName, l_INT_NAME))
+        int tmpType = va_arg (types, int);
+        this->paramDesc->types[i] = tmpType;
+
+        //! @todo SWITCH CASE WITH l_[TYPE]_TYPE -> much faster (more usefull)
+        switch (tmpType)
         {
-          sprintf(defaultVal, "%d", va_arg(types, l_INT_TYPE));
-        }
-        else if (!strcmp(tmpTypeName, l_LONG_NAME))
-        {
-          sprintf(defaultVal, "%0.3f", va_arg(types, l_LONG_TYPE));
-        }
-          /*          else if (!strcmp(tmpTypeName, l_SHORT_NAME))
-        {
-        sprintf(defaultVal, "%d", va_arg(types, l_SHORT_TYPE));
-      }*/
-        else if (!strcmp(tmpTypeName, l_FLOAT_NAME))
-        {
-          sprintf(defaultVal, "%0.3f", va_arg(types, double));
-        }
-        else if (!strcmp(tmpTypeName, l_STRING_NAME))
-        {
-          sprintf(defaultVal, "%s", va_arg(types, l_STRING_TYPE));
-        }
-        else if (!strcmp(tmpTypeName, l_XML_ELEM_NAME))
-        {
-          sprintf(defaultVal, "");
+          case ParameterInt:
+            sprintf(defaultVal, "%d", va_arg(types, l_INT_TYPE));
+            break;
+          case ParameterLong:
+            sprintf(defaultVal, "%0.3f", va_arg(types, l_LONG_TYPE));
+            break;
+          case ParameterFloat:
+            sprintf(defaultVal, "%0.3f", va_arg(types, double));
+            break;
+          case ParameterString:
+            sprintf(defaultVal, "%s", va_arg(types, l_STRING_TYPE));
+            break;
+          case ParameterXML:
+            sprintf(defaultVal, "");
+            break;
         }
 
@@ -144,11 +138,4 @@
 LoadParamDescription::~LoadParamDescription()
 {
-  if (this->types != NULL)
-  {
-    for(int i = 0; i < this->paramCount; i++)
-    {
-      delete []this->types[i];
-    }
-  }
   if (this->defaultValues != NULL)
   {
@@ -184,5 +171,34 @@
       if (i > 0)
         PRINT(3)(",");
-      PRINT(3)("%s", this->types[i]);
+      switch (this->types[i])
+      {
+        default:
+          PRINTF(3)("none");
+          break;
+        case ParameterBool:
+          PRINT(3)("bool");
+          break;
+        case ParameterChar:
+          PRINT(3)("char");
+          break;
+        case ParameterString:
+          PRINT(3)("string");
+          break;
+        case ParameterInt:
+          PRINT(3)("int");
+          break;
+        case ParameterUInt:
+          PRINT(3)("Uint");
+          break;
+        case ParameterFloat:
+          PRINT(3)("float");
+          break;
+        case ParameterLong:
+          PRINT(3)("long");
+          break;
+        case ParameterXML:
+          PRINT(3)("XML");
+          break;
+      }
     }
   PRINT(3)("</%s>", this->paramName);
@@ -197,5 +213,5 @@
       if (i > 0)
         PRINT(3)(", ");
-      if (!strcmp(this->types[i], l_STRING_NAME))
+      if (this->types[i] & ParameterString)
       { // leave brackets !!
         PRINT(3)("\"%s\"", this->defaultValues[i]);
Index: trunk/src/util/loading/load_param.h
===================================================================
--- trunk/src/util/loading/load_param.h	(revision 5301)
+++ trunk/src/util/loading/load_param.h	(revision 5332)
@@ -22,4 +22,5 @@
 #define _LOAD_PARAM_H
 
+#include "functor_list.h"
 #include "base_object.h"
 
@@ -33,4 +34,74 @@
 template<class T> class tList;
 
+/************************
+*** DESCRIPTION STUFF ***
+************************/
+//! A class that handles the description of loadable parameters
+class LoadParamDescription
+{
+  friend class BaseLoadParam;
+  friend class LoadClassDescription;
+ public:
+  LoadParamDescription(const char* paramName);
+  ~LoadParamDescription();
+
+  void setDescription(const char* descriptionText);
+  /** @returns the descriptionString */
+  const char* getDescription() { return this->description; };
+
+  void print() const;
+ private:
+  char*         paramName;             //!< The name of the parameter.
+  int           paramCount;            //!< The count of parameters.
+  int*          types;                 //!< What kind of parameters does this function take ??
+  char*         description;           //!< A longer description about this function.
+  char**        defaultValues;         //!< The 'Default Values'.
+};
+
+//! A class for descriptions of a loadable module
+class LoadClassDescription
+{
+  friend class BaseLoadParam;
+ public:
+  LoadClassDescription(const char* className);
+  ~LoadClassDescription();
+
+  static LoadClassDescription* addClass(const char* className);
+  LoadParamDescription* addParam(const char* paramName);
+
+  static void deleteAllDescriptions();
+
+  static void printAll(const char* fileName = NULL);
+  static tList<const char>* searchClassWithShort(const char* classNameBegin);
+//  static const LoadParamDescription* getClass(const char* className);
+
+ private:
+  static bool                          parametersDescription;  //!< if parameter-description should be enabled.
+  static tList<LoadClassDescription>*  classList;              //!< a list, that holds all the loadable classes. (after one instance has been loaded)
+  char*                                className;              //!< name of the class
+  tList<LoadParamDescription>*         paramList;              //!< List of parameters this class knows.
+};
+
+
+/**************************
+**** REAL DECLARATIONS ****
+**************************/
+//! abstract Base class for a Loadable parameter
+class BaseLoadParam : public BaseObject
+{
+ public:
+  BaseLoadParam* describe(const char* descriptionText);
+
+ protected:
+  BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName, int paramCount, bool multi, const void* pointerToParam, ...);
+
+ protected:
+  LoadClassDescription*    classDesc;            //!< The LoadClassDescription of this LoadParameter
+  LoadParamDescription*    paramDesc;            //!< The LoadParameterDescription of this LoadParameter
+  const char*              loadString;           //!< The string loaded by this LoadParam
+  const void*              pointerToParam;       //!< A Pointer to a Parameter.
+};
+
+
 //! macro that makes it even more easy to load a Parameter
 /**
@@ -51,11 +122,11 @@
                                  element = root->FirstChildElement(); \
                                  while( element != NULL) \
-                                  {
-/**
- * closes a LoadParam Loop
- * @see LOAD_PARAM_START_CYCLE
+{
+/**
+   * closes a LoadParam Loop
+   * @see LOAD_PARAM_START_CYCLE
  */
 #define LOAD_PARAM_END_CYCLE        element = element->NextSiblingElement(); \
-                                  }
+}
 
 
@@ -65,5 +136,5 @@
 // 0. TYPES
 /**
- *  a Macro to easily implement many different Constructors for the LoadParam-Class with no argument
+ * a Macro to easily implement many different Constructors for the LoadParam-Class with no argument
  */
 #define LoadParam0() \
@@ -79,31 +150,31 @@
 // 1. TYPE
 /**
- *  a Macro to easily implement many different Constructors for the LoadParam-Class with 1 argument
- * @param type1 The type of the first functionParameter
-*/
+ * a Macro to easily implement many different Constructors for the LoadParam-Class with 1 argument
+ * @param type1 The type of the first functionParameter
+ */
 #define LoadParam1(type1) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE), \
            bool multi = false, type1##_TYPE default1 = type1##_DEFAULT) \
-  : BaseLoadParam(root, pt2Object, paramName, 1, multi, NULL, type1##_NAME, default1) \
-    { \
+  : BaseLoadParam(root, pt2Object, paramName, 1, multi, NULL, type1##_PARAM, default1) \
+{ \
       if (loadString != NULL && root != NULL) \
         (*pt2Object.*function)(type1##_FUNC(loadString, default1)); \
       else \
         PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
-    }
+}
 
 // 2. TYPES
 /**
- *  a Macro to easily implement many different Constructors for the LoadParam-Class with 2 arguments
+ * a Macro to easily implement many different Constructors for the LoadParam-Class with 2 arguments
  * @param type1 The type of the first functionParameter
  * @param type2 The type of the second functionParameter
-*/
+ */
 #define LoadParam2(type1, type2) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE), \
            bool multi = false,  type1##_TYPE default1 = type1##_DEFAULT,  type2##_TYPE default2 = type2##_DEFAULT) \
-  : BaseLoadParam(root, pt2Object, paramName, 2, multi, NULL, type1##_NAME, default1, type2##_NAME, default2) \
-    { \
-      if (loadString != NULL && root != NULL) \
-        { \
+  : BaseLoadParam(root, pt2Object, paramName, 2, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2) \
+{ \
+      if (loadString != NULL && root != NULL) \
+{ \
           SubString subLoads(loadString); \
           if (subLoads.getCount() == 2) \
@@ -112,24 +183,24 @@
             PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \
                       paramName, pt2Object->getClassName(), 2, subLoads.getCount()); \
-        } \
-      else \
-        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
-    }
+} \
+      else \
+        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
+}
 
 
 // 3. TYPES
 /**
- *  a Macro to easily implement many different Constructors for the LoadParam-Class with 3 arguments
+ * a Macro to easily implement many different Constructors for the LoadParam-Class with 3 arguments
  * @param type1 The type of the first functionParameter
  * @param type2 The type of the second functionParameter
  * @param type3 The type of the third functionParameter
-*/
+ */
 #define LoadParam3(type1, type2, type3) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE), \
            bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT)\
-  : BaseLoadParam(root, pt2Object, paramName, 3, multi, NULL, type1##_NAME, default1, type2##_NAME, default2, type3##_NAME, default3) \
-    { \
-      if (loadString != NULL && root != NULL) \
-        { \
+  : BaseLoadParam(root, pt2Object, paramName, 3, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2, type3##_PARAM, default3) \
+{ \
+      if (loadString != NULL && root != NULL) \
+{ \
           SubString subLoads(loadString); \
           if (subLoads.getCount() == 3) \
@@ -138,27 +209,27 @@
             PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \
                       paramName, pt2Object->getClassName(), 3, subLoads.getCount()); \
-        } \
-      else \
-        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
-    }
+} \
+      else \
+        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
+}
 
 
 // 4. TYPES
 /**
- *  a Macro to easily implement many different Constructors for the LoadParam-Class with 4 arguments
+ * a Macro to easily implement many different Constructors for the LoadParam-Class with 4 arguments
  * @param type1 The type of the first functionParameter
  * @param type2 The type of the second functionParameter
  * @param type3 The type of the third functionParameter
  * @param type4 The type of the forth functionParameter
-*/
+ */
 #define LoadParam4(type1, type2, type3, type4) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE), \
            bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT, \
            type4##_TYPE default4 = type4##_DEFAULT) \
-  : BaseLoadParam(root, pt2Object, paramName, 4, multi, NULL, type1##_NAME, default1, type2##_NAME, default2, type3##_NAME, default3, \
-                  type4##_NAME, default4) \
-    { \
-      if (loadString != NULL && root != NULL) \
-        { \
+  : BaseLoadParam(root, pt2Object, paramName, 4, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2, type3##_PARAM, default3, \
+                  type4##_PARAM, default4) \
+{ \
+      if (loadString != NULL && root != NULL) \
+{ \
           SubString subLoads(loadString); \
           if (subLoads.getCount() == 4) \
@@ -167,13 +238,13 @@
             PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \
                       paramName, pt2Object->getClassName(), 4, subLoads.getCount()); \
-        } \
-      else \
-        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
-    }
+} \
+      else \
+        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
+}
 
 
 // 5. TYPES
 /**
- *  a Macro to easily implement many different Constructors for the LoadParam-Class with 5 arguments
+ * a Macro to easily implement many different Constructors for the LoadParam-Class with 5 arguments
  * @param type1 The type of the first functionParameter
  * @param type2 The type of the second functionParameter
@@ -181,5 +252,5 @@
  * @param type4 The type of the forth functionParameter
  * @param type5 The type of the fifth functionParameter
-*/
+ */
 #define LoadParam5(type1, type2, type3, type4, type5) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, \
@@ -187,9 +258,9 @@
            bool multi = false, type1##_TYPE default1 = type1##_DEFAULT, type2##_TYPE default2 = type2##_DEFAULT, type3##_TYPE default3 = type3##_DEFAULT, \
            type4##_TYPE default4 = type4##_DEFAULT, type5##_TYPE default5 = type5##_DEFAULT ) \
-  : BaseLoadParam(root, pt2Object, paramName, 5, multi, NULL, type1##_NAME, default1, type2##_NAME, default2, type3##_NAME, default3, \
-                  type4##_NAME, default4, type5##_NAME, default5) \
-    { \
-      if (loadString != NULL && root != NULL) \
-        { \
+  : BaseLoadParam(root, pt2Object, paramName, 5, multi, NULL, type1##_PARAM, default1, type2##_PARAM, default2, type3##_PARAM, default3, \
+                  type4##_PARAM, default4, type5##_PARAM, default5) \
+{ \
+      if (loadString != NULL && root != NULL) \
+{ \
           SubString subLoads(loadString); \
           if (subLoads.getCount() == 5) \
@@ -198,17 +269,17 @@
             PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n", \
                       paramName, pt2Object->getClassName(), 5, subLoads.getCount()); \
-        } \
-      else \
-        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
-    }
+} \
+      else \
+        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
+}
 
 // Pointer TYPE
 /**
- *  a Macro to easily implement many different Constructors for the LoadParam-Class with one Pointer argument
+ * a Macro to easily implement many different Constructors for the LoadParam-Class with one Pointer argument
  * @param type1 The type of the Pointer
  */
 #define LoadParamPT(type1) \
  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(type1##_TYPE), type1##_TYPE pointerToParam, bool multi = false) \
-  : BaseLoadParam(root, pt2Object, paramName, 1, multi, pointerToParam, type1##_NAME) \
+  : BaseLoadParam(root, pt2Object, paramName, 1, multi, pointerToParam, type1##_PARAM) \
 { \
       if (pointerToParam != NULL && root != NULL) \
@@ -217,74 +288,4 @@
         PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName()); \
 }
-
-/************************
-*** DESCRIPTION STUFF ***
-************************/
-//! A class that handles the description of loadable parameters
-class LoadParamDescription
-{
-  friend class BaseLoadParam;
-  friend class LoadClassDescription;
- public:
-  LoadParamDescription(const char* paramName);
-  ~LoadParamDescription();
-
-  void setDescription(const char* descriptionText);
-  /** @returns the descriptionString */
-  const char* getDescription() { return this->description; };
-
-  void print() const;
- private:
-  char*         paramName;             //!< The name of the parameter.
-  int           paramCount;            //!< The count of parameters.
-  char**        types;                 //!< What kind of parameters does this function take ??
-  char*         description;           //!< A longer description about this function.
-  char**        defaultValues;         //!< The 'Default Values'.
-};
-
-//! A class for descriptions of a loadable module
-class LoadClassDescription
-{
-  friend class BaseLoadParam;
- public:
-  LoadClassDescription(const char* className);
-  ~LoadClassDescription();
-
-  static LoadClassDescription* addClass(const char* className);
-  LoadParamDescription* addParam(const char* paramName);
-
-  static void deleteAllDescriptions();
-
-  static void printAll(const char* fileName = NULL);
-  static tList<const char>* searchClassWithShort(const char* classNameBegin);
-//  static const LoadParamDescription* getClass(const char* className);
-
- private:
-  static bool                          parametersDescription;  //!< if parameter-description should be enabled.
-  static tList<LoadClassDescription>*  classList;              //!< a list, that holds all the loadable classes. (after one instance has been loaded)
-  char*                                className;              //!< name of the class
-  tList<LoadParamDescription>*         paramList;              //!< List of parameters this class knows.
-};
-
-
-/**************************
-**** REAL DECLARATIONS ****
-**************************/
-//! abstract Base class for a Loadable parameter
-class BaseLoadParam : public BaseObject
-{
- public:
-  BaseLoadParam* describe(const char* descriptionText);
-
- protected:
-  BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName, int paramCount, bool multi, const void* pointerToParam, ...);
-
- protected:
-  LoadClassDescription*    classDesc;            //!< The LoadClassDescription of this LoadParameter
-  LoadParamDescription*    paramDesc;            //!< The LoadParameterDescription of this LoadParameter
-  const char*              loadString;           //!< The string loaded by this LoadParam
-  const void*              pointerToParam;       //!< A Pointer to a Parameter.
-};
-
 
 //! derived template class, so all the Classes can load something.
