-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathIsolateWrapper.h
More file actions
44 lines (35 loc) · 823 Bytes
/
IsolateWrapper.h
File metadata and controls
44 lines (35 loc) · 823 Bytes
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
//
// IsolateWrapper.h
// NativeScript
//
// Created by Eduardo Speroni on 2/23/23.
// Copyright © 2023 Progress. All rights reserved.
//
#ifndef IsolateWrapper_h
#define IsolateWrapper_h
#include "v8.h"
#include "Caches.h"
#include "Constants.h"
namespace tns {
class IsolateWrapper {
public:
bool IsValid() const;
inline std::shared_ptr<tns::Caches> GetCache() const {
return tns::Caches::Get(isolate_);
}
inline v8::Isolate* Isolate() {
return isolate_;
}
inline int IsolateId() {
return isolateId_;
}
inline IsolateWrapper(v8::Isolate* isolate) {
isolate_ = isolate;
isolateId_ = tns::Caches::Get(isolate_)->getIsolateId();
}
private:
v8::Isolate* isolate_;
int isolateId_;
};
}
#endif /* IsolateWrapper_h */