-
Notifications
You must be signed in to change notification settings - Fork 25
/
object.h
66 lines (59 loc) · 1.03 KB
/
object.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
/**
* object.h
*
* Class that wraps around a PHP object to make it available in
* ecmascript. As in PHP, properties added to the object, both
* from ecmascript and PHP, will become visible on the other
* side.
*
* @copyright 2015 Copernica B.V.
*/
/**
* Include guard
*/
#pragma once
/**
* Dependencies
*/
#include <phpcpp.h>
#include <v8.h>
#include "stack.h"
/**
* Start namespace
*/
namespace JS {
/**
* Class definition
*/
class Object
{
private:
/**
* The object template
* @var Stack<v8::ObjectTemplate>
*/
Stack<v8::ObjectTemplate> _template;
/**
* The PHP object we wrap
* @var Php::Object
*/
Php::Object _object;
public:
/**
* Constructor
*
* @param object The object to wrap
*/
Object(Php::Object object);
/**
* Retrieve the ecmascript object handle
* that can be assigned directly to v8
*
* @return v8::Local<v8::Value>
*/
operator v8::Local<v8::Value> ();
};
/**
* End namespace
*/
}