Index: trunk/src/lib/shell/shell_command.h
===================================================================
--- trunk/src/lib/shell/shell_command.h	(revision 5160)
+++ trunk/src/lib/shell/shell_command.h	(revision 5161)
@@ -22,4 +22,52 @@
 template<class T> class tList;
 
+
+////////////////
+// BASE CLASS //
+////////////////
+//! a baseClass for all possible ShellCommands
+class ShellCommandBase : public BaseObject
+{
+  public:
+    static bool execute (const char* executionString);
+
+    static const tList<ShellCommandBase>* getCommandList() { return ShellCommandBase::commandList; };
+
+//    static void unregisterCommand(const char* commandNaame, const char* className);
+
+    static void debug();
+
+  protected:
+    ShellCommandBase(const char* commandName, const char* className, unsigned int paramCount, ...);
+    ~ShellCommandBase();
+
+    static bool isRegistered(const char* commandName, const char* className, unsigned int paramCount, ...);
+    static const char* paramToString(long parameter);
+
+    void debugDyn();
+
+  private:
+    virtual void executeCommand (BaseObject* object, const char* parameters) = NULL;
+
+  protected:
+    void*                            functionPointer;     //!< The pointeer to the function of the Class (or static pointer if ClassID == CL_NULL )
+    unsigned int                     paramCount;          //!< the count of parameters
+    unsigned int*                    parameters;          //!< Parameters
+    bool                             isSingleton;         //!< if the Class is Singleton @todo autocheck
+    char*                            defaultStrings[FUNCTOR_MAX_ARGUMENTS];
+    int                              defaultInts[FUNCTOR_MAX_ARGUMENTS];
+    float                            defaultFloats[FUNCTOR_MAX_ARGUMENTS];
+    bool                             defaultBools[FUNCTOR_MAX_ARGUMENTS];
+
+  private:
+//    long                             classID;             //!< The ID of the Class associated to this Command
+    const char*                      className;           //!< The Name of the Class associated to this Command
+
+    // STATIC MEMBERS
+    static tList<ShellCommandBase>*  commandList;         //!< A list of availiable commands.
+};
+
+///////////////////////////////////////////////////
+///////////////////////////////////////////////////
 
 ///////////////////////
@@ -38,48 +86,49 @@
 // NO ARGUMENTS
 #define ShellCommandRegister0() \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)()) \
-  { \
-    if (isRegistered(commandName, classID, 0)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function); \
+  static ShellCommand<T>* registerCommand(const char* commandName, const char* className, void (T::*function)()) \
+  { \
+    if (isRegistered(commandName, className, 0)== true) \
+      return NULL; \
+    return new ShellCommand<T>(commandName, className, function); \
   }
 
 #define ShellCommandRegister1(t1) \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE), t1##_TYPE d1 = t1##_DEFAULT) \
-  { \
-    if (isRegistered(commandName, classID, 1, t1##_PARAM)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function, d1); \
+  static ShellCommand<T>* registerCommand(const char* commandName, const char* className, void (T::*function)(t1##_TYPE), t1##_TYPE d1 = t1##_DEFAULT) \
+  { \
+    if (isRegistered(commandName, className, 1, t1##_PARAM)== true) \
+      return NULL; \
+    return new ShellCommand<T>(commandName, className, function, d1); \
   }
 
 #define ShellCommandRegister2(t1,t2) \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT) \
-  { \
-    if (isRegistered(commandName, classID, 2, t1##_PARAM, t2##_PARAM)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function, d1, d2); \
+  static ShellCommand<T>* registerCommand(const char* commandName, const char* className, void (T::*function)(t1##_TYPE, t2##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT) \
+  { \
+    if (isRegistered(commandName, className, 2, t1##_PARAM, t2##_PARAM)== true) \
+      return NULL; \
+    return new ShellCommand<T>(commandName, className, function, d1, d2); \
   }
 
 #define ShellCommandRegister3(t1,t2,t3) \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT) \
-  { \
-    if (isRegistered(commandName, classID, 3, t1##_PARAM, t2##_PARAM, t3##_PARAM)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function, d1, d2, d3); \
+  static ShellCommand<T>* registerCommand(const char* commandName, const char* className, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT) \
+  { \
+    if (isRegistered(commandName, className, 3, t1##_PARAM, t2##_PARAM, t3##_PARAM)== true) \
+      return NULL; \
+    return new ShellCommand<T>(commandName, className, function, d1, d2, d3); \
   }
 
 #define ShellCommandRegister4(t1,t2,t3,t4) \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT, t4##_TYPE d4 = t4##_DEFAULT) \
-  { \
-    if (isRegistered(commandName, classID, 4, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function, d1, d2, d3, d4); \
-  }
+  static ShellCommand<T>* registerCommand(const char* commandName, const char* className, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT, t4##_TYPE d4 = t4##_DEFAULT) \
+  { \
+    if (isRegistered(commandName, className, 4, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM)== true) \
+      return NULL; \
+    return new ShellCommand<T>(commandName, className, function, d1, d2, d3, d4); \
+  }
+
 #define ShellCommandRegister5(t1,t2,t3,t4,t5) \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT, t4##_TYPE d4 = t4##_DEFAULT, t5##_TYPE d5 = t5##_DEFAULT) \
-  { \
-    if (isRegistered(commandName, classID, 5, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function, d1, d2, d3, d4, d5); \
+  static ShellCommand<T>* registerCommand(const char* commandName, const char* className, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT, t4##_TYPE d4 = t4##_DEFAULT, t5##_TYPE d5 = t5##_DEFAULT) \
+  { \
+    if (isRegistered(commandName, className, 5, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM)== true) \
+      return NULL; \
+    return new ShellCommand<T>(commandName, className, function, d1, d2, d3, d4, d5); \
   }
 
@@ -89,6 +138,6 @@
 #define ShellCommandConstructor0() \
   void (T::*functionPointer_0)(); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)()) \
-  : ShellCommandBase(commandName, classID, 0) \
+  ShellCommand(const char* commandName, const char* className, void (T::*function)()) \
+  : ShellCommandBase(commandName, className, 0) \
   { \
     this->functionPointer_0 = function; \
@@ -97,6 +146,6 @@
 #define ShellCommandConstructor1(t1) \
   void (T::*functionPointer_1_##t1)(t1##_TYPE); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE), t1##_TYPE d1) \
-  : ShellCommandBase(commandName, classID, 1, t1##_PARAM, d1) \
+  ShellCommand(const char* commandName, const char* className, void (T::*function)(t1##_TYPE), t1##_TYPE d1) \
+  : ShellCommandBase(commandName, className, 1, t1##_PARAM, d1) \
   { \
     this->functionPointer_1_##t1 = function; \
@@ -105,6 +154,6 @@
 #define ShellCommandConstructor2(t1,t2) \
   void (T::*functionPointer_2_##t1##_##t2)(t1##_TYPE, t2##_TYPE); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE), t1##_TYPE d1, t2##_TYPE d2) \
-  : ShellCommandBase(commandName, classID, 2, t1##_PARAM, d1, t2##_PARAM, d2) \
+  ShellCommand(const char* commandName, const char* className, void (T::*function)(t1##_TYPE, t2##_TYPE), t1##_TYPE d1, t2##_TYPE d2) \
+  : ShellCommandBase(commandName, className, 2, t1##_PARAM, d1, t2##_PARAM, d2) \
   { \
     this->functionPointer_2_##t1##_##t2 = function; \
@@ -113,6 +162,6 @@
 #define ShellCommandConstructor3(t1,t2,t3) \
   void (T::*functionPointer_3_##t1##_##t2##_##t3)(t1##_TYPE, t2##_TYPE, t3##_TYPE); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3) \
-  : ShellCommandBase(commandName, classID, 3, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3) \
+  ShellCommand(const char* commandName, const char* className, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3) \
+  : ShellCommandBase(commandName, className, 3, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3) \
   { \
     this->functionPointer_3_##t1##_##t2##_##t3 = function; \
@@ -121,6 +170,6 @@
 #define ShellCommandConstructor4(t1,t2,t3,t4) \
   void (T::*functionPointer_4_##t1##_##t2##_##t3##_##t4)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3, t4##_TYPE d4) \
-  : ShellCommandBase(commandName, classID, 4, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4) \
+  ShellCommand(const char* commandName, const char* className, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3, t4##_TYPE d4) \
+  : ShellCommandBase(commandName, className, 4, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4) \
   { \
     this->functionPointer_4_##t1##_##t2##_##t3##_##t4 = function; \
@@ -129,6 +178,6 @@
 #define ShellCommandConstructor5(t1,t2,t3,t4,t5) \
   void (T::*functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3, t4##_TYPE d4, t5##_TYPE d5) \
-  : ShellCommandBase(commandName, classID, 5, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4, t5##_PARAM, d5) \
+  ShellCommand(const char* commandName, const char* className, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3, t4##_TYPE d4, t5##_TYPE d5) \
+  : ShellCommandBase(commandName, className, 5, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4, t5##_PARAM, d5) \
   { \
     this->functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5 = function; \
@@ -163,51 +212,8 @@
 
 
-
-////////////////
-// BASE CLASS //
-////////////////
-//! a baseClass for all possible ShellCommands
-class ShellCommandBase : public BaseObject
-{
-  public:
-    static bool execute (const char* executionString);
-
-    static const tList<ShellCommandBase>* getCommandList() { return ShellCommandBase::commandList; };
-
-
-  protected:
-    ShellCommandBase(const char* commandName, ClassID classID, unsigned int paramCount, ...);
-    ~ShellCommandBase();
-
-    static bool isRegistered(const char* commandName, ClassID classID, unsigned int paramCount, ...);
-    static const char* paramToString(long parameter);
-
-    void debug();
-  private:
-    virtual void executeCommand (BaseObject* object, const char* parameters) = NULL;
-
-  protected:
-    void*                            functionPointer;     //!< The pointeer to the function of the Class (or static pointer if ClassID == CL_NULL )
-    unsigned int                     paramCount;          //!< the count of parameters
-    unsigned int*                    parameters;          //!< Parameters
-    bool                             isSingleton;         //!< if the Class is Singleton @todo autocheck
-    char*                            defaultStrings[FUNCTOR_MAX_ARGUMENTS];
-    int                              defaultInts[FUNCTOR_MAX_ARGUMENTS];
-    float                            defaultFloats[FUNCTOR_MAX_ARGUMENTS];
-    bool                             defaultBools[FUNCTOR_MAX_ARGUMENTS];
-
-  private:
-    long                             classID;             //!< The ID of the Class associated to this Command
-    const char*                      className;           //!< The Name of the Class associated to this Command
-
-    // STATIC MEMBERS
-    static tList<ShellCommandBase>*  commandList;         //!< A list of availiable commands.
-};
-
 //! keeps information about a ShellCommand
 template<class T> class ShellCommand : public ShellCommandBase
 {
   public:
-    static void unregisterCommand(const char* commandNaame, ClassID classID);
 
 #ifdef FUNCTOR_LIST
