forked from RobinD42/pybindgen-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautogentest.h
71 lines (49 loc) · 1.46 KB
/
autogentest.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// An abstract base class
class A
{
public:
A() {}
virtual ~A() {}
virtual void virtualMethod1() = 0; // pure virtual
virtual void virtualMethod2() {} // normal virtual
};
// derived class
class B : public A
{
public:
B() : A() {}
B(int a, int b) {} // overloaded ctor
virtual void virtualMethod1() {} // implement pure virtual
void overloadedMethod() {}
void overloadedMethod(int a, int b) {}
void overloadedMethod(double d) {}
void defaultArgs(int a = 0, int b = 123) {}
bool operator==(const B& other) { return false; }
bool operator!=(const B& other) { return true; }
B& operator+(const B& other) { return *this; }
// anything special done for these?
int __len__() { return 0; } // yes, added to sequence methods structure
int __int__() { return 0; } // no but the method is still there
operator bool() { return true; } // no
static void staticMethod() {}
int m_publicAttribute;
};
// derived class with protected members
class C : public B
{
public:
C() : B() {}
C(int a, int b) : B(a, b) {}
A* returnBaseClassPtr() { return this; }
void baseClassParameterPtr(const A* ptr) {}
void baseClassParameterRef(const A& ptr) {}
protected:
int protectedMethod() { return 0; }
virtual int protectedVirtualMethod() { return 0; }
// int m_protectedAttribute;
};
enum TestEnum {
VALUE1 = 100,
VALUE2,
VALUE3
};