diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-03-02 14:34:01 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-03-02 17:18:20 -0300 |
commit | 3a4263a603b8caa4f93dcd534971bf7ffaf65e9f (patch) | |
tree | fc98bf94b965e9f5f35c7150463b4966d7620e49 /tests/libsample/abstract.h | |
parent | ac7573693042bc8f9d4d94958d89d5b15add39f2 (diff) |
Use polymorphic-id-expression to discover the correct type of a C++ object.
Diffstat (limited to 'tests/libsample/abstract.h')
-rw-r--r-- | tests/libsample/abstract.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/libsample/abstract.h b/tests/libsample/abstract.h index 06f8d983e..008570560 100644 --- a/tests/libsample/abstract.h +++ b/tests/libsample/abstract.h @@ -50,6 +50,10 @@ public: ClassNameAndId }; + enum Type { + TpAbstract, TpDerived + }; + int primitiveField; Point valueTypeField; ObjectType* objectTypeField; @@ -76,6 +80,7 @@ public: void callUnpureVirtual(); void show(PrintFormat format = Verbose); + virtual Type type() const { return TpAbstract; } protected: virtual const char* className() { return "Abstract"; } |