Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
v8::PersistentBase< T > Class Template Reference

#include <v8.h>

Inheritance diagram for v8::PersistentBase< T >:
[legend]

Public Member Functions

void Reset ()
 
template<class S >
void Reset (Isolate *isolate, const Local< S > &other)
 
template<class S >
void Reset (Isolate *isolate, const PersistentBase< S > &other)
 
bool IsEmpty () const
 
void Empty ()
 
Local< T > Get (Isolate *isolate) const
 
template<class S >
bool operator== (const PersistentBase< S > &that) const
 
template<class S >
bool operator== (const Local< S > &that) const
 
template<class S >
bool operator!= (const PersistentBase< S > &that) const
 
template<class S >
bool operator!= (const Local< S > &that) const
 
template<typename P >
void SetWeak (P *parameter, typename WeakCallbackInfo< P >::Callback callback, WeakCallbackType type)
 
void SetWeak ()
 
template<typename P >
P * ClearWeak ()
 
void ClearWeak ()
 
void RegisterExternalReference (Isolate *isolate) const
 
void MarkIndependent ()
 
void MarkActive ()
 
bool IsIndependent () const
 
bool IsNearDeath () const
 
bool IsWeak () const
 
void SetWrapperClassId (uint16_t class_id)
 
uint16_t WrapperClassId () const
 
 PersistentBase (const PersistentBase &other)=delete
 
void operator= (const PersistentBase &)=delete
 

Friends

class Isolate
 
class Utils
 
template<class F >
class Local
 
template<class F1 , class F2 >
class Persistent
 
template<class F >
class Global
 
template<class F >
class PersistentBase
 
template<class F >
class ReturnValue
 
template<class F1 , class F2 , class F3 >
class PersistentValueMapBase
 
template<class F1 , class F2 >
class PersistentValueVector
 
class Object
 

Detailed Description

template<class T>
class v8::PersistentBase< T >

An object reference that is independent of any handle scope. Where a Local handle only lives as long as the HandleScope in which it was allocated, a PersistentBase handle remains valid until it is explicitly disposed using Reset().

A persistent handle contains a reference to a storage cell within the V8 engine which holds an object value and which is updated by the garbage collector whenever the object is moved. A new storage cell can be created using the constructor or PersistentBase::Reset and existing handles can be disposed using PersistentBase::Reset.

Constructor & Destructor Documentation

◆ PersistentBase()

template<class T >
v8::PersistentBase< T >::PersistentBase ( const PersistentBase< T > &  other)
delete

Member Function Documentation

◆ ClearWeak() [1/2]

template<class T >
template<typename P >
P * v8::PersistentBase< T >::ClearWeak
inline

◆ ClearWeak() [2/2]

template<class T >
void v8::PersistentBase< T >::ClearWeak ( )
inline

◆ Empty()

template<class T >
void v8::PersistentBase< T >::Empty ( )
inline

◆ Get()

template<class T >
Local< T > v8::PersistentBase< T >::Get ( Isolate isolate) const
inline
Here is the call graph for this function:

◆ IsEmpty()

template<class T >
bool v8::PersistentBase< T >::IsEmpty ( ) const
inline
Here is the caller graph for this function:

◆ IsIndependent()

template<class T >
bool v8::PersistentBase< T >::IsIndependent
inline

◆ IsNearDeath()

template<class T >
bool v8::PersistentBase< T >::IsNearDeath
inline

Checks if the handle holds the only reference to an object.

◆ IsWeak()

template<class T >
bool v8::PersistentBase< T >::IsWeak
inline

Returns true if the handle's reference is weak.

Here is the caller graph for this function:

◆ MarkActive()

template<class T >
void v8::PersistentBase< T >::MarkActive
inline

Marks the reference to this object as active. The scavenge garbage collection should not reclaim the objects marked as active. This bit is cleared after the each garbage collection pass.

◆ MarkIndependent()

template<class T >
void v8::PersistentBase< T >::MarkIndependent
inline

Marks the reference to this object independent. Garbage collector is free to ignore any object groups containing this object. Weak callback for an independent handle should not assume that it will be preceded by a global GC prologue callback or followed by a global GC epilogue callback.

◆ operator!=() [1/2]

template<class T >
template<class S >
bool v8::PersistentBase< T >::operator!= ( const Local< S > &  that) const
inline
Here is the call graph for this function:

◆ operator!=() [2/2]

template<class T >
template<class S >
bool v8::PersistentBase< T >::operator!= ( const PersistentBase< S > &  that) const
inline
Here is the call graph for this function:

◆ operator=()

template<class T >
void v8::PersistentBase< T >::operator= ( const PersistentBase< T > &  )
delete

◆ operator==() [1/2]

template<class T >
template<class S >
bool v8::PersistentBase< T >::operator== ( const Local< S > &  that) const
inline

◆ operator==() [2/2]

template<class T >
template<class S >
bool v8::PersistentBase< T >::operator== ( const PersistentBase< S > &  that) const
inline
Here is the caller graph for this function:

◆ RegisterExternalReference()

template<class T >
void v8::PersistentBase< T >::RegisterExternalReference ( Isolate isolate) const
inline

Allows the embedder to tell the v8 garbage collector that a certain object is alive. Only allowed when the embedder is asked to trace its heap by EmbedderHeapTracer.

◆ Reset() [1/3]

template<class T >
void v8::PersistentBase< T >::Reset
inline

If non-empty, destroy the underlying storage cell IsEmpty() will return true after this call.

Here is the caller graph for this function:

◆ Reset() [2/3]

template<class T >
template<class S >
void v8::PersistentBase< T >::Reset ( Isolate isolate,
const Local< S > &  other 
)
inline

If non-empty, destroy the underlying storage cell and create a new one with the contents of other if other is non empty

Here is the call graph for this function:

◆ Reset() [3/3]

template<class T >
template<class S >
void v8::PersistentBase< T >::Reset ( Isolate isolate,
const PersistentBase< S > &  other 
)
inline

If non-empty, destroy the underlying storage cell and create a new one with the contents of other if other is non empty

Here is the call graph for this function:

◆ SetWeak() [1/2]

template<class T >
void v8::PersistentBase< T >::SetWeak
inline

Turns this handle into a weak phantom handle without finalization callback. The handle will be reset automatically when the garbage collector detects that the object is no longer reachable. A related function Isolate::NumberOfPhantomHandleResetsSinceLastCall returns how many phantom handles were reset by the garbage collector.

◆ SetWeak() [2/2]

template<class T >
template<typename P >
void v8::PersistentBase< T >::SetWeak ( P *  parameter,
typename WeakCallbackInfo< P >::Callback  callback,
WeakCallbackType  type 
)
inline

Install a finalization callback on this object. NOTE: There is no guarantee as to when or even if the callback is invoked. The invocation is performed solely on a best effort basis. As always, GC-based finalization should not be relied upon for any critical form of resource management!

◆ SetWrapperClassId()

template<class T >
void v8::PersistentBase< T >::SetWrapperClassId ( uint16_t  class_id)
inline

Assigns a wrapper class ID to the handle. See RetainedObjectInfo interface description in v8-profiler.h for details.

◆ WrapperClassId()

template<class T >
uint16_t v8::PersistentBase< T >::WrapperClassId
inline

Returns the class ID previously assigned to this handle or 0 if no class ID was previously assigned.

Friends And Related Function Documentation

◆ Global

template<class T >
template<class F >
friend class Global
friend

◆ Isolate

template<class T >
friend class Isolate
friend

◆ Local

template<class T >
template<class F >
friend class Local
friend

◆ Object

template<class T >
friend class Object
friend

◆ Persistent

template<class T >
template<class F1 , class F2 >
friend class Persistent
friend

◆ PersistentBase

template<class T >
template<class F >
friend class PersistentBase
friend

◆ PersistentValueMapBase

template<class T >
template<class F1 , class F2 , class F3 >
friend class PersistentValueMapBase
friend

◆ PersistentValueVector

template<class T >
template<class F1 , class F2 >
friend class PersistentValueVector
friend

◆ ReturnValue

template<class T >
template<class F >
friend class ReturnValue
friend

◆ Utils

template<class T >
friend class Utils
friend

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