v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::PersistentValueMapBase< K, V, Traits > Class Template Reference

#include <v8-util.h>

Inheritance diagram for v8::PersistentValueMapBase< K, V, Traits >:
Collaboration diagram for v8::PersistentValueMapBase< K, V, Traits >:

Classes

class  PersistentValueReference
 

Public Member Functions

IsolateGetIsolate ()
 
size_t Size ()
 
bool IsWeak ()
 
Local< VGet (const K &key)
 
bool Contains (const K &key)
 
bool SetReturnValue (const K &key, ReturnValue< Value > returnValue)
 
Global< VRemove (const K &key)
 
void Clear ()
 
PersistentValueReference GetReference (const K &key)
 

Protected Member Functions

 PersistentValueMapBase (Isolate *isolate)
 
 PersistentValueMapBase (Isolate *isolate, const char *label)
 
 ~PersistentValueMapBase ()
 
Isolateisolate ()
 
Traits::Impl * impl ()
 
void RemoveWeak (const K &key)
 
void AnnotateStrongRetainer (Global< V > *persistent)
 

Static Protected Member Functions

static VFromVal (PersistentContainerValue v)
 
static PersistentContainerValue ClearAndLeak (Global< V > *persistent)
 
static PersistentContainerValue Leak (Global< V > *persistent)
 
static Global< VRelease (PersistentContainerValue v)
 

Private Member Functions

 PersistentValueMapBase (PersistentValueMapBase &)
 
void operator= (PersistentValueMapBase &)
 

Static Private Member Functions

static bool SetReturnValueFromVal (ReturnValue< Value > *returnValue, PersistentContainerValue value)
 

Private Attributes

Isolateisolate_
 
Traits::Impl impl_
 
const char * label_
 

Detailed Description

template<typename K, typename V, typename Traits>
class v8::PersistentValueMapBase< K, V, Traits >

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.

Definition at line 166 of file v8-util.h.

Constructor & Destructor Documentation

◆ PersistentValueMapBase() [1/3]

template<typename K , typename V , typename Traits >
v8::PersistentValueMapBase< K, V, Traits >::PersistentValueMapBase ( Isolate * isolate)
inlineexplicitprotected

Definition at line 291 of file v8-util.h.

◆ PersistentValueMapBase() [2/3]

template<typename K , typename V , typename Traits >
v8::PersistentValueMapBase< K, V, Traits >::PersistentValueMapBase ( Isolate * isolate,
const char * label )
inlineprotected

Definition at line 293 of file v8-util.h.

◆ ~PersistentValueMapBase()

template<typename K , typename V , typename Traits >
v8::PersistentValueMapBase< K, V, Traits >::~PersistentValueMapBase ( )
inlineprotected

Definition at line 296 of file v8-util.h.

Here is the call graph for this function:

◆ PersistentValueMapBase() [3/3]

template<typename K , typename V , typename Traits >
v8::PersistentValueMapBase< K, V, Traits >::PersistentValueMapBase ( PersistentValueMapBase< K, V, Traits > & )
private

Member Function Documentation

◆ AnnotateStrongRetainer()

template<typename K , typename V , typename Traits >
void v8::PersistentValueMapBase< K, V, Traits >::AnnotateStrongRetainer ( Global< V > * persistent)
inlineprotected

Definition at line 338 of file v8-util.h.

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

◆ Clear()

template<typename K , typename V , typename Traits >
void v8::PersistentValueMapBase< K, V, Traits >::Clear ( )
inline

Traverses the map repeatedly, in case side effects of disposal cause insertions.

Definition at line 218 of file v8-util.h.

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

◆ ClearAndLeak()

template<typename K , typename V , typename Traits >
static PersistentContainerValue v8::PersistentValueMapBase< K, V, Traits >::ClearAndLeak ( Global< V > * persistent)
inlinestaticprotected

Definition at line 306 of file v8-util.h.

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

◆ Contains()

template<typename K , typename V , typename Traits >
bool v8::PersistentValueMapBase< K, V, Traits >::Contains ( const K & key)
inline

Check whether a value is contained in the map.

Definition at line 194 of file v8-util.h.

◆ FromVal()

template<typename K , typename V , typename Traits >
static V * v8::PersistentValueMapBase< K, V, Traits >::FromVal ( PersistentContainerValue v)
inlinestaticprotected

Definition at line 301 of file v8-util.h.

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

◆ Get()

template<typename K , typename V , typename Traits >
Local< V > v8::PersistentValueMapBase< K, V, Traits >::Get ( const K & key)
inline

Get value stored in map.

Definition at line 183 of file v8-util.h.

Here is the call graph for this function:

◆ GetIsolate()

template<typename K , typename V , typename Traits >
Isolate * v8::PersistentValueMapBase< K, V, Traits >::GetIsolate ( )
inline

Definition at line 168 of file v8-util.h.

◆ GetReference()

template<typename K , typename V , typename Traits >
PersistentValueReference v8::PersistentValueMapBase< K, V, Traits >::GetReference ( const K & key)
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.

Definition at line 286 of file v8-util.h.

◆ impl()

template<typename K , typename V , typename Traits >
Traits::Impl * v8::PersistentValueMapBase< K, V, Traits >::impl ( )
inlineprotected

Definition at line 299 of file v8-util.h.

Here is the caller graph for this function:

◆ isolate()

template<typename K , typename V , typename Traits >
Isolate * v8::PersistentValueMapBase< K, V, Traits >::isolate ( )
inlineprotected

Definition at line 298 of file v8-util.h.

Here is the caller graph for this function:

◆ IsWeak()

template<typename K , typename V , typename Traits >
bool v8::PersistentValueMapBase< K, V, Traits >::IsWeak ( )
inline

Return whether the map holds weak persistents.

Definition at line 178 of file v8-util.h.

◆ Leak()

template<typename K , typename V , typename Traits >
static PersistentContainerValue v8::PersistentValueMapBase< K, V, Traits >::Leak ( Global< V > * persistent)
inlinestaticprotected

Definition at line 312 of file v8-util.h.

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

◆ operator=()

template<typename K , typename V , typename Traits >
void v8::PersistentValueMapBase< K, V, Traits >::operator= ( PersistentValueMapBase< K, V, Traits > & )
private

◆ Release()

template<typename K , typename V , typename Traits >
static Global< V > v8::PersistentValueMapBase< K, V, Traits >::Release ( PersistentContainerValue v)
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 321 of file v8-util.h.

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

◆ Remove()

template<typename K , typename V , typename Traits >
Global< V > v8::PersistentValueMapBase< K, V, Traits >::Remove ( const K & key)
inline

Return value for key and remove it from the map.

Definition at line 210 of file v8-util.h.

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

◆ RemoveWeak()

template<typename K , typename V , typename Traits >
void v8::PersistentValueMapBase< K, V, Traits >::RemoveWeak ( const K & key)
inlineprotected

Definition at line 331 of file v8-util.h.

Here is the call graph for this function:

◆ SetReturnValue()

template<typename K , typename V , typename Traits >
bool v8::PersistentValueMapBase< K, V, Traits >::SetReturnValue ( const K & key,
ReturnValue< Value > returnValue )
inline

Get value stored in map and set it in returnValue. Return true if a value was found.

Definition at line 202 of file v8-util.h.

Here is the call graph for this function:

◆ SetReturnValueFromVal()

template<typename K , typename V , typename Traits >
static bool v8::PersistentValueMapBase< K, V, Traits >::SetReturnValueFromVal ( ReturnValue< Value > * returnValue,
PersistentContainerValue value )
inlinestaticprivate

Definition at line 346 of file v8-util.h.

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

◆ Size()

template<typename K , typename V , typename Traits >
size_t v8::PersistentValueMapBase< K, V, Traits >::Size ( )
inline

Return size of the map.

Definition at line 173 of file v8-util.h.

Member Data Documentation

◆ impl_

template<typename K , typename V , typename Traits >
Traits::Impl v8::PersistentValueMapBase< K, V, Traits >::impl_
private

Definition at line 356 of file v8-util.h.

◆ isolate_

template<typename K , typename V , typename Traits >
Isolate* v8::PersistentValueMapBase< K, V, Traits >::isolate_
private

Definition at line 355 of file v8-util.h.

◆ label_

template<typename K , typename V , typename Traits >
const char* v8::PersistentValueMapBase< K, V, Traits >::label_
private

Definition at line 357 of file v8-util.h.


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