-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathva_node_process.h
103 lines (82 loc) · 2.62 KB
/
va_node_process.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#ifndef VA_Node_Process_Interface
#define VA_Node_Process_Interface
/************************
***** Components *****
************************/
#include "va_node_entity.h"
/**************************
***** Declarations *****
**************************/
/*************************
***** Definitions *****
*************************/
namespace VA {
namespace Node {
class Callback;
class Isolate;
class Isolated;
class Process : public Entity {
DECLARE_ABSTRACT_RTTLITE (Process, Entity);
friend class Callback;
friend class Isolate;
// Implementation Classes
public:
class Primary;
class Secondary;
// Construction
protected:
Process () {
}
// Destruction
protected:
~Process () {
}
// Isolate Management ...
// ... Interface
public:
static bool Attach (
ClassTraits<Isolate>::retaining_ptr_t &rpModelObject, v8::Isolate *pIsolate
) {
return Implementation ()->attach (rpModelObject, pIsolate);
}
private:
static bool Detach (Isolate *pModelObject) {
return Implementation ()->detach (pModelObject);
}
public:
static size_t IsolateCacheSize () {
return Implementation ()->isolateCacheSize ();
}
// ... Implementation
private:
virtual bool attach (
ClassTraits<Isolate>::retaining_ptr_t &rpModelObject, v8::Isolate *pIsolate
) = 0;
virtual bool detach (Isolate *pModelObject) = 0;
virtual size_t isolateCacheSize () const = 0;
// Lifetime Management ...
// ... Interface
private:
static bool OkToDecommission (Isolated *pIsolated) {
return Implementation ()->okToDecommission (pIsolated);
}
// ... Implementation
private:
virtual bool okToDecommission (Isolated *pIsolated) = 0;
// Callback Management ...
// ... Interface
private:
static void ScheduleCallback (Callback *pCallback) {
return Implementation ()->scheduleCallback (pCallback);
}
// ... Implementation
private:
virtual void scheduleCallback (Callback *pCallback) = 0;
private:
// Implementation
public:
static Process *Implementation ();
};
} // namespace VA::Node
} // namespace VA
#endif