v8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | List of all members
v8::PersistentBase< T > Class Template Reference

#include <v8.h>

Inheritance diagram for v8::PersistentBase< T >:
v8::Global< T > v8::Persistent< T, M >

Public Member Functions

V8_INLINE void Reset ()
 
template<class S >
V8_INLINE void Reset (Isolate *isolate, const Handle< S > &other)
 
template<class S >
V8_INLINE void Reset (Isolate *isolate, const PersistentBase< S > &other)
 
V8_INLINE bool IsEmpty () const
 
V8_INLINE void Empty ()
 
template<class S >
V8_INLINE bool operator== (const PersistentBase< S > &that) const
 
template<class S >
V8_INLINE bool operator== (const Handle< S > &that) const
 
template<class S >
V8_INLINE bool operator!= (const PersistentBase< S > &that) const
 
template<class S >
V8_INLINE bool operator!= (const Handle< S > &that) const
 
template<typename P >
V8_INLINE V8_DEPRECATE_SOON ("use WeakCallbackInfo version", void SetWeak(P *parameter, typename WeakCallbackData< T, P >::Callback callback))
 
template<typename S , typename P >
V8_INLINE V8_DEPRECATE_SOON ("use WeakCallbackInfo version", void SetWeak(P *parameter, typename WeakCallbackData< S, P >::Callback callback))
 
template<typename P >
V8_INLINE V8_DEPRECATE_SOON ("use SetWeak", void SetPhantom(P *parameter, typename WeakCallbackInfo< P >::Callback callback, int internal_field_index1=-1, int internal_field_index2=-1))
 
template<typename P >
V8_INLINE void SetWeak (P *parameter, typename WeakCallbackInfo< P >::Callback callback, WeakCallbackType type)
 
template<typename P >
V8_INLINE P * ClearWeak ()
 
V8_INLINE void ClearWeak ()
 
V8_INLINE void MarkIndependent ()
 
V8_INLINE void MarkPartiallyDependent ()
 
V8_INLINE bool IsIndependent () const
 
V8_INLINE bool IsNearDeath () const
 
V8_INLINE bool IsWeak () const
 
V8_INLINE void SetWrapperClassId (uint16_t class_id)
 
V8_INLINE uint16_t WrapperClassId () const
 
template<class S >
void Reset (Isolate *isolate, const Handle< S > &other)
 
template<class S >
void Reset (Isolate *isolate, const PersistentBase< S > &other)
 
template<typename P >
void SetWeak (P *parameter, typename WeakCallbackData< T, P >::Callback callback)
 

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.

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.

Member Function Documentation

template<class T>
template<typename P >
V8_INLINE P* v8::PersistentBase< T >::ClearWeak ( )
template<class T>
P * v8::PersistentBase< T >::ClearWeak ( )
inline
template<class T>
V8_INLINE void v8::PersistentBase< T >::Empty ( )
inline
template<class T>
V8_INLINE bool v8::PersistentBase< T >::IsEmpty ( ) const
inline
template<class T >
bool v8::PersistentBase< T >::IsIndependent ( ) const
template<class T >
bool v8::PersistentBase< T >::IsNearDeath ( ) const

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

template<class T >
bool v8::PersistentBase< T >::IsWeak ( ) const

Returns true if the handle's reference is weak.

template<class T >
void v8::PersistentBase< T >::MarkIndependent ( )

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.

template<class T >
void v8::PersistentBase< T >::MarkPartiallyDependent ( )

Marks the reference to this object partially dependent. Partially dependent handles only depend on other partially dependent handles and these dependencies are provided through object groups. It provides a way to build smaller object groups for young objects that represent only a subset of all external dependencies. This mark is automatically cleared after each garbage collection.

template<class T>
template<class S >
V8_INLINE bool v8::PersistentBase< T >::operator!= ( const PersistentBase< S > &  that) const
inline
template<class T>
template<class S >
V8_INLINE bool v8::PersistentBase< T >::operator!= ( const Handle< S > &  that) const
inline
template<class T>
template<class S >
V8_INLINE bool v8::PersistentBase< T >::operator== ( const PersistentBase< S > &  that) const
inline
template<class T>
template<class S >
V8_INLINE bool v8::PersistentBase< T >::operator== ( const Handle< S > &  that) const
inline
template<class T >
void v8::PersistentBase< T >::Reset ( )

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

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

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

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

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

template<class T>
template<class S >
void v8::PersistentBase< T >::Reset ( Isolate isolate,
const Handle< S > &  other 
)
template<class T>
template<class S >
void v8::PersistentBase< T >::Reset ( Isolate isolate,
const PersistentBase< S > &  other 
)
template<class T >
template<typename P >
V8_INLINE void v8::PersistentBase< T >::SetWeak ( P *  parameter,
typename WeakCallbackInfo< P >::Callback  callback,
WeakCallbackType  type 
)
template<class T>
template<typename P >
void v8::PersistentBase< T >::SetWeak ( P *  parameter,
typename WeakCallbackData< T, P >::Callback  callback 
)
template<class T >
void v8::PersistentBase< T >::SetWrapperClassId ( uint16_t  class_id)

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

template<class T>
template<typename P >
V8_INLINE v8::PersistentBase< T >::V8_DEPRECATE_SOON ( "use WeakCallbackInfo version"  ,
void   SetWeakP *parameter, typename WeakCallbackData< T, P >::Callback callback 
)

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!

template<class T>
template<typename S , typename P >
V8_INLINE v8::PersistentBase< T >::V8_DEPRECATE_SOON ( "use WeakCallbackInfo version"  ,
void   SetWeakP *parameter, typename WeakCallbackData< S, P >::Callback callback 
)
template<class T>
template<typename P >
V8_INLINE v8::PersistentBase< T >::V8_DEPRECATE_SOON ( "use SetWeak ,
void   SetPhantomP *parameter, typename WeakCallbackInfo< P >::Callback callback, int internal_field_index1=-1, int internal_field_index2=-1 
)
template<class T >
uint16_t v8::PersistentBase< T >::WrapperClassId ( ) const

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

Friends And Related Function Documentation

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

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