diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-08-17 19:31:37 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-08-17 19:31:37 -0300 |
commit | e0c29962e6f334452f0c9db2caaf6ed18065de85 (patch) | |
tree | cee27801c196fbcacf6130ad64216af133b555dd /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.h | 37 |
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 + |