15 #ifndef FFA_TYPE_CHECK_H
16 #define FFA_TYPE_CHECK_H
39 #define Fmd_HEADER_INIT() \
41 virtual bool isOfType(int tp) const; \
42 virtual int getTypeID() const; \
43 virtual const char* getTypeIDName() const; \
45 static const char* getClassTypeIDName(); \
46 static int getClassTypeID(); \
47 static int getParentClassTypeID(); \
50 static bool staticIsOfType(int tp); \
53 static const char* typeIDName
62 #define Fmd_BASE_HEADER_INIT() \
65 const char* itsTypeIDName; \
75 #define Fmd_CONSTRUCTOR_INIT(clType) \
76 itsTypeID = clType::getClassTypeID(); \
77 itsTypeIDName = clType::getClassTypeIDName()
85 #define Fmd_SOURCE_INIT(clName, clType, prClType) \
87 int clType::typeID = FFaTypeCheck::getNewTypeID(#clName);\
88 const char* clType::typeIDName = #clName; \
90 int clType::getTypeID() const \
95 const char* clType::getTypeIDName() const \
97 return itsTypeIDName; \
100 int clType::getClassTypeID() \
105 const char* clType::getClassTypeIDName() \
110 int clType::getParentClassTypeID() \
112 return prClType::getClassTypeID(); \
115 bool clType::isOfType(int tp) const \
117 if (itsTypeID == tp) \
120 return prClType::staticIsOfType(tp); \
123 bool clType::staticIsOfType(int tp) \
127 else if (typeID == prClType::getClassTypeID()) \
130 return prClType::staticIsOfType(tp); \
Type checking control.
Definition: FFaTypeCheck.H:20
int getNewTypeID(const char *typeName)
Returns a unique type ID number for typeName.
Definition: FFaTypeCheck.C:35
constexpr int NO_TYPE_ID
Value for undefined type ID number.
Definition: FFaTypeCheck.H:28
const char * getTypeNameFromID(int typeID)
Returns the type name associated with the specified typeID.
Definition: FFaTypeCheck.C:65
int getTypeIDFromName(const char *typeName)
Returns the type ID number for typeName, if it exists.
Definition: FFaTypeCheck.C:50