1
0
Эх сурвалжийг харах

ENH: Add classname to commands

Andy Cedilnik 20 жил өмнө
parent
commit
4c658a5bc5

+ 6 - 0
Source/cmCommand.h

@@ -103,6 +103,11 @@ public:
    */
   virtual const char* GetName() = 0;
 
+  /**
+   * The class name of the command.
+   */
+  virtual const char* GetClassName() = 0;
+
   /**
    * Succinct documentation.
    */
@@ -183,6 +188,7 @@ private:
 
 // All subclasses of cmCommand should invoke this macro.
 #define cmTypeMacro(thisClass,superclass) \
+virtual const char* GetClassName() { return #thisClass; } \
 typedef superclass Superclass; \
 static bool IsTypeOf(const char *type) \
 { \

+ 2 - 0
Source/cmConfigureFileCommand.h

@@ -22,6 +22,8 @@
 class cmConfigureFileCommand : public cmCommand
 {
 public:
+  cmTypeMacro(cmConfigureFileCommand, cmCommand);
+
   virtual cmCommand* Clone() 
     {
       return new cmConfigureFileCommand;

+ 2 - 0
Source/cmFLTKWrapUICommand.h

@@ -27,6 +27,8 @@
 class cmFLTKWrapUICommand : public cmCommand
 {
 public:
+  cmTypeMacro(cmFLTKWrapUICommand, cmCommand);
+
   /**
    * This is a virtual constructor for the command.
    */

+ 2 - 0
Source/cmQTWrapCPPCommand.h

@@ -29,6 +29,8 @@
 class cmQTWrapCPPCommand : public cmCommand
 {
 public:
+  cmTypeMacro(cmQTWrapCPPCommand, cmCommand);
+
   /**
    * This is a virtual constructor for the command.
    */

+ 1 - 0
Source/cmQTWrapUICommand.h

@@ -29,6 +29,7 @@
 class cmQTWrapUICommand : public cmCommand
 {
 public:
+  cmTypeMacro(cmQTWrapUICommand, cmCommand);
   /**
    * This is a virtual constructor for the command.
    */

+ 2 - 0
Source/cmUseMangledMesaCommand.h

@@ -30,6 +30,8 @@
 class cmUseMangledMesaCommand : public cmCommand
 {
 public:
+  cmTypeMacro(cmUseMangledMesaCommand, cmCommand);
+
   /**
    * This is a virtual constructor for the command.
    */

+ 2 - 0
Source/cmVTKWrapJavaCommand.h

@@ -29,6 +29,8 @@
 class cmVTKWrapJavaCommand : public cmCommand
 {
 public:
+  cmTypeMacro(cmVTKWrapJavaCommand, cmCommand);
+
   /**
    * This is a virtual constructor for the command.
    */

+ 2 - 0
Source/cmVTKWrapPythonCommand.h

@@ -29,6 +29,8 @@
 class cmVTKWrapPythonCommand : public cmCommand
 {
 public:
+  cmTypeMacro(cmVTKWrapPythonCommand, cmCommand);
+
   /**
    * This is a virtual constructor for the command.
    */

+ 2 - 0
Source/cmVTKWrapTclCommand.h

@@ -30,6 +30,8 @@
 class cmVTKWrapTclCommand : public cmCommand
 {
 public:
+  cmTypeMacro(cmVTKWrapTclCommand, cmCommand);
+
   /**
    * This is a virtual constructor for the command.
    */