blob: 1dc131e55eadb0bad43235e876b33841328320cc (
plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
/**
* Base class for defining your own objects
*
* @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
* @copyright 2013 Copernica BV
*/
/**
* Namespace
*/
namespace Php {
/**
* Class definition
*/
class Base
{
public:
/**
* Constructor
*/
Base() {}
/**
* Virtual destructor
*/
virtual ~Base() {}
/**
* The pseudo constructor that is called from PHP after the object is constructed
* @param environment
* @param parameters
*/
virtual void __construct(Environment &environment, const Parameters ¶meters)
{
// call all other possible implementations
__construct(environment);
__construct(parameters);
__construct();
}
/**
* The pseudo constructor that is called from PHP after the object is constructed
* @param environment
*/
virtual void __construct(Environment &environment) {}
/**
* The pseudo constructor that is called from PHP after the object is constructed
* @param parameters
*/
virtual void __construct(const Parameters ¶meters) {}
/**
* The pseudo constructor that is called from PHP after the object is constructed
*/
virtual void __construct() {}
/**
* The pseudo destructor that is called from PHP right before the object is destructed
* @param environment
*/
virtual void __destruct(Environment &environment)
{
// call the other implementation
__destruct();
}
/**
* The pseudo destructor that is called from PHP right before the object is destructed
*/
virtual void __destruct() {}
/**
* Get access to a property by name
* @param string
* @return Property
*/
// Property operator[](const char *name);
/**
* Alternative way to access a property
* @param string
* @return Property
*/
// Property operator[](const std::string &name);
protected:
/**
* All properties of the object
* @var Properties
*/
// Properties _properties;
private:
};
/**
* Definition of a method
*/
typedef void (Base::*method_callback_0)();
typedef void (Base::*method_callback_1)(Parameters &);
typedef void (Base::*method_callback_2)(Environment &);
typedef void (Base::*method_callback_3)(Environment &, Parameters &);
typedef Value (Base::*method_callback_4)();
typedef Value (Base::*method_callback_5)(Parameters &);
typedef Value (Base::*method_callback_6)(Environment &);
typedef Value (Base::*method_callback_7)(Environment &, Parameters &);
/**
* End of namespace
*/
}
|