cmTypeMacro: mark overridden functions with CM_OVERRIDE

This commit is contained in:
Tobias Hunger 2016-06-29 09:31:51 +02:00 committed by Daniel Pfeifer
parent b9b3ec4d98
commit 4e8480db54
1 changed files with 5 additions and 2 deletions

View File

@ -15,7 +15,7 @@
// All subclasses of cmCommand or cmCTestGenericHandler should // All subclasses of cmCommand or cmCTestGenericHandler should
// invoke this macro. // invoke this macro.
#define cmTypeMacro(thisClass, superclass) \ #define cmTypeMacro(thisClass, superclass) \
virtual const char* GetNameOfClass() { return #thisClass; } \ const char* GetNameOfClass() CM_OVERRIDE { return #thisClass; } \
typedef superclass Superclass; \ typedef superclass Superclass; \
static bool IsTypeOf(const char* type) \ static bool IsTypeOf(const char* type) \
{ \ { \
@ -24,7 +24,10 @@
} \ } \
return Superclass::IsTypeOf(type); \ return Superclass::IsTypeOf(type); \
} \ } \
virtual bool IsA(const char* type) { return thisClass::IsTypeOf(type); } \ bool IsA(const char* type) CM_OVERRIDE \
{ \
return thisClass::IsTypeOf(type); \
} \
static thisClass* SafeDownCast(cmObject* c) \ static thisClass* SafeDownCast(cmObject* c) \
{ \ { \
if (c && c->IsA(#thisClass)) { \ if (c && c->IsA(#thisClass)) { \