-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathperson_wrap.hpp
More file actions
38 lines (29 loc) · 1.47 KB
/
person_wrap.hpp
File metadata and controls
38 lines (29 loc) · 1.47 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 PERSON_WRAP_H
#define PERSON_WRAP_H
#include <node.h>
#include <node_object_wrap.h>
#include "person.hpp"
#include "book.hpp"
class PersonWrap : public node::ObjectWrap {
friend class BookWrap;
public:
static void Init(v8::Handle<v8::Object> exports);
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
static v8::Handle<v8::Object> New(v8::Isolate* isolate, Book* n, uint32_t index);
static v8::Handle<v8::Object> NewInstance();
// getters and setters
static void FirstnameGetter(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info);
static void FirstnameSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info);
static void LastnameGetter(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info);
static void LastnameSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info);
static void BirthdayGetter(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info);
static void BirthdaySetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info);
// function wrappers
static void ToString(const v8::FunctionCallbackInfo<v8::Value>& args);
PersonWrap();
private:
~PersonWrap();
Person* m_person;
static v8::Persistent<v8::Function> Constructor;
};
#endif // PERSON_WRAP_H