Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:05:23

0001 // Copyright 2021 the V8 project authors. All rights reserved.
0002 // Use of this source code is governed by a BSD-style license that can be
0003 // found in the LICENSE file.
0004 
0005 #ifndef INCLUDE_V8_EXTERNAL_H_
0006 #define INCLUDE_V8_EXTERNAL_H_
0007 
0008 #include "v8-value.h"  // NOLINT(build/include_directory)
0009 #include "v8config.h"  // NOLINT(build/include_directory)
0010 
0011 namespace v8 {
0012 
0013 class Isolate;
0014 
0015 /**
0016  * A JavaScript value that wraps a C++ void*. This type of value is mainly used
0017  * to associate C++ data structures with JavaScript objects.
0018  */
0019 class V8_EXPORT External : public Value {
0020  public:
0021   static Local<External> New(Isolate* isolate, void* value);
0022   V8_INLINE static External* Cast(Value* value) {
0023 #ifdef V8_ENABLE_CHECKS
0024     CheckCast(value);
0025 #endif
0026     return static_cast<External*>(value);
0027   }
0028 
0029   void* Value() const;
0030 
0031  private:
0032   static void CheckCast(v8::Value* obj);
0033 };
0034 
0035 }  // namespace v8
0036 
0037 #endif  // INCLUDE_V8_EXTERNAL_H_