1 |
3a515b92
|
cagy
|
/*********************************************************************
|
2 |
|
|
* NAN - Native Abstractions for Node.js
|
3 |
|
|
*
|
4 |
|
|
* Copyright (c) 2018 NAN contributors
|
5 |
|
|
*
|
6 |
|
|
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
7 |
|
|
********************************************************************/
|
8 |
|
|
|
9 |
|
|
#ifndef NAN_CALLBACKS_H_
|
10 |
|
|
#define NAN_CALLBACKS_H_
|
11 |
|
|
|
12 |
|
|
template<typename T> class FunctionCallbackInfo;
|
13 |
|
|
template<typename T> class PropertyCallbackInfo;
|
14 |
|
|
template<typename T> class Global;
|
15 |
|
|
|
16 |
|
|
typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>&);
|
17 |
|
|
typedef void(*GetterCallback)
|
18 |
|
|
(v8::Local<v8::String>, const PropertyCallbackInfo<v8::Value>&);
|
19 |
|
|
typedef void(*SetterCallback)(
|
20 |
|
|
v8::Local<v8::String>,
|
21 |
|
|
v8::Local<v8::Value>,
|
22 |
|
|
const PropertyCallbackInfo<void>&);
|
23 |
|
|
typedef void(*PropertyGetterCallback)(
|
24 |
|
|
v8::Local<v8::String>,
|
25 |
|
|
const PropertyCallbackInfo<v8::Value>&);
|
26 |
|
|
typedef void(*PropertySetterCallback)(
|
27 |
|
|
v8::Local<v8::String>,
|
28 |
|
|
v8::Local<v8::Value>,
|
29 |
|
|
const PropertyCallbackInfo<v8::Value>&);
|
30 |
|
|
typedef void(*PropertyEnumeratorCallback)
|
31 |
|
|
(const PropertyCallbackInfo<v8::Array>&);
|
32 |
|
|
typedef void(*PropertyDeleterCallback)(
|
33 |
|
|
v8::Local<v8::String>,
|
34 |
|
|
const PropertyCallbackInfo<v8::Boolean>&);
|
35 |
|
|
typedef void(*PropertyQueryCallback)(
|
36 |
|
|
v8::Local<v8::String>,
|
37 |
|
|
const PropertyCallbackInfo<v8::Integer>&);
|
38 |
|
|
typedef void(*IndexGetterCallback)(
|
39 |
|
|
uint32_t,
|
40 |
|
|
const PropertyCallbackInfo<v8::Value>&);
|
41 |
|
|
typedef void(*IndexSetterCallback)(
|
42 |
|
|
uint32_t,
|
43 |
|
|
v8::Local<v8::Value>,
|
44 |
|
|
const PropertyCallbackInfo<v8::Value>&);
|
45 |
|
|
typedef void(*IndexEnumeratorCallback)
|
46 |
|
|
(const PropertyCallbackInfo<v8::Array>&);
|
47 |
|
|
typedef void(*IndexDeleterCallback)(
|
48 |
|
|
uint32_t,
|
49 |
|
|
const PropertyCallbackInfo<v8::Boolean>&);
|
50 |
|
|
typedef void(*IndexQueryCallback)(
|
51 |
|
|
uint32_t,
|
52 |
|
|
const PropertyCallbackInfo<v8::Integer>&);
|
53 |
|
|
|
54 |
|
|
namespace imp {
|
55 |
|
|
typedef v8::Local<v8::AccessorSignature> Sig;
|
56 |
|
|
|
57 |
|
|
static const int kDataIndex = 0;
|
58 |
|
|
|
59 |
|
|
static const int kFunctionIndex = 1;
|
60 |
|
|
static const int kFunctionFieldCount = 2;
|
61 |
|
|
|
62 |
|
|
static const int kGetterIndex = 1;
|
63 |
|
|
static const int kSetterIndex = 2;
|
64 |
|
|
static const int kAccessorFieldCount = 3;
|
65 |
|
|
|
66 |
|
|
static const int kPropertyGetterIndex = 1;
|
67 |
|
|
static const int kPropertySetterIndex = 2;
|
68 |
|
|
static const int kPropertyEnumeratorIndex = 3;
|
69 |
|
|
static const int kPropertyDeleterIndex = 4;
|
70 |
|
|
static const int kPropertyQueryIndex = 5;
|
71 |
|
|
static const int kPropertyFieldCount = 6;
|
72 |
|
|
|
73 |
|
|
static const int kIndexPropertyGetterIndex = 1;
|
74 |
|
|
static const int kIndexPropertySetterIndex = 2;
|
75 |
|
|
static const int kIndexPropertyEnumeratorIndex = 3;
|
76 |
|
|
static const int kIndexPropertyDeleterIndex = 4;
|
77 |
|
|
static const int kIndexPropertyQueryIndex = 5;
|
78 |
|
|
static const int kIndexPropertyFieldCount = 6;
|
79 |
|
|
|
80 |
|
|
} // end of namespace imp
|
81 |
|
|
|
82 |
|
|
#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
83 |
|
|
# include "nan_callbacks_12_inl.h" // NOLINT(build/include)
|
84 |
|
|
#else
|
85 |
|
|
# include "nan_callbacks_pre_12_inl.h" // NOLINT(build/include)
|
86 |
|
|
#endif
|
87 |
|
|
|
88 |
|
|
#endif // NAN_CALLBACKS_H_
|