-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbook_wrap.hpp
More file actions
38 lines (28 loc) · 1.19 KB
/
book_wrap.hpp
File metadata and controls
38 lines (28 loc) · 1.19 KB
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
#ifndef BOOK_WRAP_H
#define BOOK_WRAP_H
#include <node.h>
#include <node_object_wrap.h>
#include "book.hpp"
#include "person.hpp"
class BookWrap : public node::ObjectWrap {
public:
static void Init(v8::Handle<v8::Object> exports);
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
// getter and setter
static void Getter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info);
static void Setter(uint32_t index, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info);
static void Deleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info);
static void Enumerator(const v8::PropertyCallbackInfo<v8::Array>& info);
// function wrappers
static void Add(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Lookup(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Length(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Each(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Apply(const v8::FunctionCallbackInfo<v8::Value>& args);
BookWrap();
private:
~BookWrap();
Book* m_book;
static v8::Persistent<v8::Function> Constructor;
};
#endif