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
29};
30
33 "Internal external pointer tags must be the last tags in the "
34 "range below V8_EXTERNAL_POINTER_TAG_COUNT.");
35
40class V8_EXPORT External : public Value {
41 public:
52 static Local<External> New(Isolate* isolate, void* value,
54 V8_INLINE static External* Cast(Data* value) {
55#ifdef V8_ENABLE_CHECKS
56 CheckCast(value);
57#endif
58 return static_cast<External*>(value);
59 }
60
69 void* Value(ExternalPointerTypeTag tag) const;
70
71 private:
72 static void CheckCast(v8::Data* obj);
73};
74
75} // namespace v8
76
77#endif // INCLUDE_V8_EXTERNAL_H_
Definition: v8-data.h:18
Definition: v8-external.h:40
static Local< External > New(Isolate *isolate, void *value, ExternalPointerTypeTag tag)
void * Value(ExternalPointerTypeTag tag) const
static External * Cast(Data *value)
Definition: v8-external.h:54
Definition: v8-isolate.h:291
Definition: v8-local-handle.h:366
Definition: v8-value.h:32
Definition: libplatform.h:15
InternalExternalPointerTypeTag
Definition: v8-external.h:25
@ kLastInternalExternalPointerTypeTag
Definition: v8-external.h:28
@ kDictionaryValueTag
Definition: v8-external.h:27
@ kFirstInternalExternalPointerTypeTag
Definition: v8-external.h:26
uint16_t ExternalPointerTypeTag
Definition: v8-external.h:21
constexpr ExternalPointerTypeTag kExternalPointerTypeTagDefault
Definition: v8-external.h:23
#define V8_EXTERNAL_POINTER_TAG_COUNT
Definition: v8-internal.h:451
#define V8_EXPORT
Definition: v8config.h:867
#define V8_INLINE
Definition: v8config.h:511