summaryrefslogtreecommitdiff
path: root/Examples/ReturnObject/master.h
blob: b4f9cebd1d0edf425183c24073d0ae5ea159b11f (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
/**
 *  Master.h
 * 
 *  Class that is exported to PHP space
 * 
 *  @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
 *  @copyright 2015 Copernica BV
 */

/**
 *  Include guard
 */
#pragma once

/**
 *  Dependencies
 */
#include "child.h"

/**
 *  Class definition
 */
class Master : public Php::Base
{
private:
    /**
     *  One child
     *  @var Php::Value
     */
    Php::Value _value;

public:
    /**
     *  Constructor
     */
    Master() 
    {
        // create a child instance
        _value = Php::Object("Child", new Child());
    }
    
    /**
     *  Destructor
     */
    virtual ~Master() {}
    
    /**
     *  Retrieve the child
     *  @return Php::Value
     */
    Php::Value child() const
    {
        return _value;
    }
    
    /**
     *  Cast to a string
     *  @return const char *
     */
    const char *__toString() const
    {
        return "this is the master";
    }
};