summaryrefslogtreecommitdiff
path: root/include/base.h
blob: 56189e28fe9bbb0eac9d7cd65393cab1bdabab83 (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
/**
 *  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  parameters
     */
    virtual void __construct(const Parameters &parameters)
    {
        // call all other possible implementations
        __construct();
    }
    
    /**
     *  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
     */
    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 Value   (Base::*method_callback_2)();
typedef Value   (Base::*method_callback_3)(Parameters &);

/**
 *  End of namespace
 */
}