v8
7.0.276 (node 11.14.0)
V8 is Google's open source JavaScript engine
|
#include <v8-util.h>
Data Structures | |
class | PersistentValueReference |
Public Member Functions | |
Isolate * | GetIsolate () |
size_t | Size () |
bool | IsWeak () |
Local< V > | Get (const K &key) |
bool | Contains (const K &key) |
bool | SetReturnValue (const K &key, ReturnValue< Value > returnValue) |
void | RegisterExternallyReferencedObject (K &key) |
Global< V > | Remove (const K &key) |
void | Clear () |
PersistentValueReference | GetReference (const K &key) |
Protected Member Functions | |
PersistentValueMapBase (Isolate *isolate) | |
~PersistentValueMapBase () | |
Isolate * | isolate () |
Traits::Impl * | impl () |
void | RemoveWeak (const K &key) |
Static Protected Member Functions | |
static V * | FromVal (PersistentContainerValue v) |
static PersistentContainerValue | ClearAndLeak (Global< V > *persistent) |
static PersistentContainerValue | Leak (Global< V > *persistent) |
static Global< V > | Release (PersistentContainerValue v) |
A map wrapper that allows using Global as a mapped value. C++11 embedders don't need this class, as they can use Global directly in std containers.
The map relies on a backing map, whose type and accessors are described by the Traits class. The backing map will handle values of type PersistentContainerValue, with all conversion into and out of V8 handles being transparently handled by this class.
|
inlineexplicitprotected |
|
inlineprotected |
Definition at line 294 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::Clear().
|
inline |
Traverses the map repeatedly, in case side effects of disposal cause insertions.
Definition at line 221 of file v8-util.h.
References HandleScope::HandleScope(), and PersistentValueMapBase< K, V, Traits >::Release().
Referenced by PersistentValueMapBase< K, V, Traits >::~PersistentValueMapBase().
|
inlinestaticprotected |
|
inline |
Check whether a value is contained in the map.
Definition at line 186 of file v8-util.h.
Referenced by PersistentValueMapBase< K, V, Traits >::RegisterExternallyReferencedObject().
|
inlinestaticprotected |
Definition at line 299 of file v8-util.h.
Referenced by PersistentValueMapBase< K, V, Traits >::Get(), PersistentValueMapBase< K, V, Traits >::PersistentValueReference::NewLocal(), PersistentValueMapBase< K, V, Traits >::RegisterExternallyReferencedObject(), PersistentValueMapBase< K, V, Traits >::Release(), and PersistentValueMapBase< K, V, Traits >::RemoveWeak().
Get value stored in map.
Definition at line 179 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::FromVal(), and Local< T >::Local.
|
inline |
Definition at line 164 of file v8-util.h.
Referenced by PersistentValueMapBase< K, V, Traits >::RegisterExternallyReferencedObject().
|
inline |
Get a reference to a map value. This enables fast, repeated access to a value stored in the map while the map remains unchanged.
Careful: This is potentially unsafe, so please use with care. The value will become invalid if the value for this key changes in the underlying map, as a result of Set or Remove for the same key; as a result of the weak callback for the same key; or as a result of calling Clear() or destruction of the map.
|
inline |
Return whether the map holds weak persistents.
Definition at line 174 of file v8-util.h.
References v8::kNotWeak.
|
inlinestaticprotected |
|
inline |
Call V8::RegisterExternallyReferencedObject with the map value for given key.
Definition at line 203 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::Contains(), PersistentValueMapBase< K, V, Traits >::FromVal(), and PersistentValueMapBase< K, V, Traits >::GetIsolate().
|
inlinestaticprotected |
Return a container value as Global and make sure the weak callback is properly disposed of. All remove functionality should go through this.
Definition at line 318 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::FromVal(), PersistentBase< T >::Global, and v8::kNotWeak.
Referenced by PersistentValueMapBase< K, V, Traits >::Clear(), and PersistentValueMapBase< K, V, Traits >::Remove().
Return value for key and remove it from the map.
Definition at line 213 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::Release().
|
inlineprotected |
Definition at line 328 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::FromVal(), and PersistentBase< T >::Global.
|
inline |