diff --git a/src/Base/BaseClass.h b/src/Base/BaseClass.h index 88b5da6c3b..6d5abd285e 100644 --- a/src/Base/BaseClass.h +++ b/src/Base/BaseClass.h @@ -114,6 +114,18 @@ public: virtual void setPyObject(PyObject *); static void *create(){return nullptr;} + + template + bool is() const + { + return getTypeId() == T::getClassTypeId(); + } + + template + bool isDerivedFrom() const + { + return getTypeId().isDerivedFrom(T::getClassTypeId()); + } private: static Type classTypeId; protected: