1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
15 #include "cmStandardIncludes.h"
18 * \brief Superclass for all commands and other classes in CMake.
20 * cmObject is the base class for all classes in CMake. It defines some
21 * methods such as GetNameOfClass, IsA, SafeDownCast.
27 * Need virtual destructor to destroy real command type.
29 virtual ~cmObject() {}
32 * The class name of the command.
34 virtual const char* GetNameOfClass() = 0;
37 * Returns true if this class is the given class, or a subclass of it.
39 static bool IsTypeOf(const char *type)
40 { return !strcmp("cmObject", type); }
43 * Returns true if this object is an instance of the given class or
46 virtual bool IsA(const char *type)
47 { return cmObject::IsTypeOf(type); }