aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/derived.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libsample/derived.h')
-rw-r--r--tests/libsample/derived.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/libsample/derived.h b/tests/libsample/derived.h
new file mode 100644
index 000000000..5efc7c4b4
--- /dev/null
+++ b/tests/libsample/derived.h
@@ -0,0 +1,46 @@
+#ifndef DERIVED_H
+#define DERIVED_H
+
+#include "abstract.h"
+
+enum PolymorphicFuncEnum {
+ PolymorphicFunc_ii,
+ PolymorphicFunc_d
+};
+
+class Derived : public Abstract
+{
+public:
+ enum OtherPolymorphicFuncEnum {
+ OtherPolymorphicFunc_iibd,
+ OtherPolymorphicFunc_id
+ };
+
+ Derived(int id = -1);
+ virtual ~Derived();
+ virtual void pureVirtual();
+ virtual void unpureVirtual();
+
+ // factory method
+ static Abstract* createObject();
+
+ // single argument
+ bool singleArgument(bool b);
+
+ // method with default value
+ double defaultValue(int n = 0);
+
+ // overloads
+ PolymorphicFuncEnum polymorphic(int i = 0, int d = 0);
+ PolymorphicFuncEnum polymorphic(double n);
+
+ // more overloads
+ OtherPolymorphicFuncEnum otherPolymorphic(int a, int b, bool c, double d);
+ OtherPolymorphicFuncEnum otherPolymorphic(int a, double b);
+
+protected:
+ const char* getClassName() { return className(); }
+ virtual const char* className() { return "Derived"; }
+};
+#endif // DERIVED_H
+