#include <v8.h>
v8::Local< T >, と v8::Persistent< T >に継承されています。
Public メソッド | |
Handle () | |
Handle (T *val) | |
template<class S > | |
Handle (Handle< S > that) | |
bool | IsEmpty () |
T * | operator-> () |
T * | operator* () |
void | Clear () |
template<class S > | |
bool | operator== (Handle< S > that) |
template<class S > | |
bool | operator!= (Handle< S > that) |
Static Public メソッド | |
template<class S > | |
static Handle< T > | Cast (Handle< S > that) |
Private 変数 | |
T * | val_ |
An object reference managed by the v8 garbage collector.
All objects returned from v8 have to be tracked by the garbage collector so that it knows that the objects are still alive. Also, because the garbage collector may move objects, it is unsafe to point directly to an object. Instead, all objects are stored in handles which are known by the garbage collector and updated whenever an object moves. Handles should always be passed by value (except in cases like out-parameters) and they should never be allocated on the heap.
There are two types of handles: local and persistent handles. Local handles are light-weight and transient and typically used in local operations. They are managed by HandleScopes. Persistent handles can be used when storing objects across several independent operations and have to be explicitly deallocated when they're no longer used.
It is safe to extract the object stored in the handle by dereferencing the handle (for instance, to extract the Object* from an Handle<Object>); the value will still be governed by a handle behind the scenes and the same rules apply to these values as to their handles.
v8::Handle< T >::Handle | ( | ) |
v8::Handle< T >::Handle | ( | T * | val | ) | [inline, explicit] |
Creates a handle for the contents of the specified handle. This constructor allows you to pass handles as arguments by value and to assign between handles. However, if you try to assign between incompatible handles, for instance from a Handle<String> to a Handle<Number> it will cause a compiletime error. Assigning between compatible handles, for instance assigning a Handle<String> to a variable declared as Handle<Value>, is legal because String is a subclass of Value.
This check fails when trying to convert between incompatible handles. For example, converting from a Handle<String> to a Handle<Number>.
static Handle<T> v8::Handle< T >::Cast | ( | Handle< S > | that | ) | [inline, static] |
void v8::Handle< T >::Clear | ( | ) | [inline] |
Sets the handle to be empty. IsEmpty() will then return true.
bool v8::Handle< T >::IsEmpty | ( | ) | [inline] |
Returns true if the handle is empty.
参照元 v8::Debug::AddDebugEventListener(), v8::FunctionTemplate::AddInstancePropertyAccessor(), v8::V8::AddMessageListener(), v8::String::AsciiValue::AsciiValue(), v8::internal::BUILTIN(), v8::Persistent< Context >::Cast(), v8::Local< Value >::Cast(), v8::Handle< Value >::Cast(), v8::Script::Compile(), v8::internal::JSObject::DeleteElementWithInterceptor(), v8::internal::JSObject::DeletePropertyWithInterceptor(), v8::Persistent< T >::Dispose(), v8::EmptyCheck(), v8::Shell::ExecuteString(), v8::internal::JSObject::GetElementWithInterceptor(), v8::internal::JSObject::GetPropertyAttributeWithInterceptor(), v8::internal::JSObject::GetPropertyWithInterceptor(), v8::internal::JSObject::HasElementWithInterceptor(), v8::Persistent< T >::IsNearDeath(), v8::Persistent< T >::IsWeak(), v8::Shell::Load(), v8::Shell::Main(), v8::Persistent< T >::New(), v8::Local< T >::New(), v8::Context::New(), v8::ObjectTemplate::New(), v8::Signature::New(), v8::FunctionTemplate::New(), v8::internal::Parser::ParseNativeDeclaration(), v8::ObjectTemplate::SetAccessCheckCallbacks(), v8::FunctionTemplate::SetCallHandler(), v8::internal::JSObject::SetElementWithInterceptor(), v8::FunctionTemplate::SetIndexedInstancePropertyHandler(), v8::FunctionTemplate::SetInstanceCallAsFunctionHandler(), v8::FunctionTemplate::SetNamedInstancePropertyHandler(), v8::String::Utf8Value::Utf8Value(), と v8::String::Value::Value().
T * v8::Handle< T >::operator* | ( | ) |
T * v8::Handle< T >::operator-> | ( | ) |
T* v8::Handle< T >::val_ [private] |