Loading...
Searching...
No Matches
v8-external.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef INCLUDE_V8_EXTERNAL_H_
6#define INCLUDE_V8_EXTERNAL_H_
7
8#include "v8-value.h" // NOLINT(build/include_directory)
9#include "v8config.h" // NOLINT(build/include_directory)
10
11namespace v8 {
12
13class Isolate;
14
21using ExternalPointerTypeTag = uint16_t;
22
24
29class V8_EXPORT External : public Value {
30 public:
41 static Local<External> New(Isolate* isolate, void* value,
43 V8_INLINE static External* Cast(Data* value) {
44#ifdef V8_ENABLE_CHECKS
45 CheckCast(value);
46#endif
47 return static_cast<External*>(value);
48 }
49
58 void* Value(ExternalPointerTypeTag tag) const;
59
60 private:
61 static void CheckCast(v8::Data* obj);
62};
63
64} // namespace v8
65
66#endif // INCLUDE_V8_EXTERNAL_H_
Definition: v8-data.h:18
Definition: v8-external.h:29
static Local< External > New(Isolate *isolate, void *value, ExternalPointerTypeTag tag)
void * Value(ExternalPointerTypeTag tag) const
static External * Cast(Data *value)
Definition: v8-external.h:43
Definition: v8-isolate.h:291
Definition: v8-local-handle.h:366
Definition: v8-value.h:32
Definition: libplatform.h:15
uint16_t ExternalPointerTypeTag
Definition: v8-external.h:21
constexpr ExternalPointerTypeTag kExternalPointerTypeTagDefault
Definition: v8-external.h:23
#define V8_EXPORT
Definition: v8config.h:854
#define V8_INLINE
Definition: v8config.h:508