V8 Project
v8::Eternal< T > Class Template Reference

#include <v8.h>

+ Collaboration diagram for v8::Eternal< T >:

Public Member Functions

 Eternal ()
 
template<class S >
 Eternal (Isolate *isolate, Local< S > handle)
 
Local< TGet (Isolate *isolate)
 
bool IsEmpty ()
 
template<class S >
void Set (Isolate *isolate, Local< S > handle)
 

Private Attributes

int index_
 

Static Private Attributes

static const int kInitialValue = -1
 

Detailed Description

template<class T>
class v8::Eternal< T >

Definition at line 398 of file v8.h.

Constructor & Destructor Documentation

◆ Eternal() [1/2]

template<class T >
v8::Eternal< T >::Eternal ( )
inline

Definition at line 400 of file v8.h.

400 : index_(kInitialValue) { }
int index_
Definition: v8.h:412
static const int kInitialValue
Definition: v8.h:411

◆ Eternal() [2/2]

template<class T >
template<class S >
v8::Eternal< T >::Eternal ( Isolate isolate,
Local< S handle 
)
inline

Definition at line 402 of file v8.h.

402  : index_(kInitialValue) {
403  Set(isolate, handle);
404  }
void Set(Isolate *isolate, Local< S > handle)
Definition: v8.h:6018
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::handle(), and v8::Eternal< T >::Set().

+ Here is the call graph for this function:

Member Function Documentation

◆ Get()

template<class T >
Local< T > v8::Eternal< T >::Get ( Isolate isolate)
inline

Definition at line 6025 of file v8.h.

6025  {
6026  return Local<T>(reinterpret_cast<T*>(*V8::GetEternal(isolate, index_)));
6027 }
static Local< Value > GetEternal(Isolate *isolate, int index)
Definition: api.cc:537
#define T(name, string, precedence)
Definition: token.cc:25

References v8::V8::GetEternal(), and T.

+ Here is the call graph for this function:

◆ IsEmpty()

template<class T >
bool v8::Eternal< T >::IsEmpty ( )
inline

Definition at line 407 of file v8.h.

407 { return index_ == kInitialValue; }

References v8::Eternal< T >::index_, and v8::Eternal< T >::kInitialValue.

◆ Set()

template<class T >
template<class S >
void v8::Eternal< T >::Set ( Isolate isolate,
Local< S handle 
)
inline

Definition at line 6018 of file v8.h.

6018  {
6019  TYPE_CHECK(T, S);
6020  V8::Eternalize(isolate, reinterpret_cast<Value*>(*handle), &this->index_);
6021 }
static void Eternalize(Isolate *isolate, Value *handle, int *index)
Definition: api.cc:530
#define TYPE_CHECK(T, S)
Definition: v8.h:167
#define S(x)
Definition: version.cc:55

References v8::V8::Eternalize(), v8::internal::handle(), S, T, and TYPE_CHECK.

Referenced by v8::Eternal< T >::Eternal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ index_

template<class T >
int v8::Eternal< T >::index_
private

Definition at line 412 of file v8.h.

Referenced by v8::Eternal< T >::IsEmpty().

◆ kInitialValue

template<class T >
const int v8::Eternal< T >::kInitialValue = -1
staticprivate

Definition at line 411 of file v8.h.

Referenced by v8::Eternal< T >::IsEmpty().


The documentation for this class was generated from the following file: