diff options
Diffstat (limited to 'tests/libsample/photon.h')
-rw-r--r-- | tests/libsample/photon.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/libsample/photon.h b/tests/libsample/photon.h index f6c97b7c7..18917e26c 100644 --- a/tests/libsample/photon.h +++ b/tests/libsample/photon.h @@ -33,6 +33,7 @@ namespace Photon { enum ClassType { + BaseType = 0, IdentityType = 1, DuplicatorType = 2 }; @@ -41,9 +42,17 @@ class LIBSAMPLE_API Base { public: explicit Base(int value) : m_value(value) {} + virtual ~Base() {} inline void setValue(int value) { m_value = value; } inline int value() const { return m_value; } + + template <class T> bool isType() { return type() == T::staticType; } + bool isType(ClassType t) { return type() == t; } + protected: + virtual ClassType type() const { return BaseType; }; + static const ClassType staticType = BaseType; + int m_value; }; @@ -68,6 +77,10 @@ public: } static inline TemplateBase<CLASS_TYPE>* passPointerThrough(TemplateBase<CLASS_TYPE>* obj) { return obj; } + +protected: + virtual ClassType type() const { return CLASS_TYPE; } + static const ClassType staticType = CLASS_TYPE; }; #if defined _WIN32 || defined __CYGWIN__ |