aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/abstract.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-08-17 19:31:37 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-08-17 19:31:37 -0300
commite0c29962e6f334452f0c9db2caaf6ed18065de85 (patch)
treecee27801c196fbcacf6130ad64216af133b555dd /tests/libsample/abstract.h
The End Is the Beginning Is the End
Diffstat (limited to 'tests/libsample/abstract.h')
-rw-r--r--tests/libsample/abstract.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/libsample/abstract.h b/tests/libsample/abstract.h
new file mode 100644
index 000000000..19e3a9dbf
--- /dev/null
+++ b/tests/libsample/abstract.h
@@ -0,0 +1,37 @@
+#ifndef ABSTRACT_H
+#define ABSTRACT_H
+
+class Abstract
+{
+public:
+ enum PrintFormat {
+ Short,
+ Verbose,
+ OnlyId,
+ ClassNameAndId
+ };
+
+ Abstract(int id = -1);
+ virtual ~Abstract();
+
+ int id() { return m_id; }
+
+ // factory method
+ static Abstract* createObject() { return 0; }
+
+ virtual void pureVirtual() = 0;
+ virtual void unpureVirtual();
+
+ void callPureVirtual();
+ void callUnpureVirtual();
+
+ void show(PrintFormat format = Verbose);
+
+protected:
+ virtual const char* className() { return "Abstract"; }
+
+private:
+ int m_id;
+};
+#endif // ABSTRACT_H
+