1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmObject.h,v $
6 Date: $Date: 2006-05-12 17:39:34 $
7 Version: $Revision: 1.2 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
20 #include "cmStandardIncludes.h"
23 * \brief Superclass for all commands and other classes in CMake.
25 * cmObject is the base class for all classes in CMake. It defines some
26 * methods such as GetNameOfClass, IsA, SafeDownCast.
32 * Need virtual destructor to destroy real command type.
34 virtual ~cmObject() {}
37 * The class name of the command.
39 virtual const char* GetNameOfClass() = 0;
42 * Returns true if this class is the given class, or a subclass of it.
44 static bool IsTypeOf(const char *type
)
45 { return !strcmp("cmObject", type
); }
48 * Returns true if this object is an instance of the given class or
51 virtual bool IsA(const char *type
)
52 { return cmObject::IsTypeOf(type
); }