aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/abstract.h
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-03-02 14:34:01 -0300
committerHugo Lima <hugo.lima@openbossa.org>2010-03-02 17:18:20 -0300
commit3a4263a603b8caa4f93dcd534971bf7ffaf65e9f (patch)
treefc98bf94b965e9f5f35c7150463b4966d7620e49 /tests/libsample/abstract.h
parentac7573693042bc8f9d4d94958d89d5b15add39f2 (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.h5
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"; }