v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PersistentValueMap< K, V, Traits > Class Template Reference

#include <v8-util.h>

Inheritance diagram for PersistentValueMap< K, V, Traits >:

Public Member Functions

V8_INLINE PersistentValueMap (Isolate *isolate)
 
V8_INLINE ~PersistentValueMap ()
 
V8_INLINE IsolateGetIsolate ()
 
V8_INLINE size_t Size ()
 
V8_INLINE bool IsWeak ()
 
V8_INLINE Local< V > Get (const K &key)
 
V8_INLINE bool Contains (const K &key)
 
V8_INLINE bool SetReturnValue (const K &key, ReturnValue< Value > &returnValue)
 
V8_INLINE void SetReference (const K &key, const Persistent< Object > &parent)
 
UniquePersistent< V > Set (const K &key, Local< V > value)
 
UniquePersistent< V > Set (const K &key, UniquePersistent< V > value)
 
V8_INLINE UniquePersistent< V > Remove (const K &key)
 
void Clear ()
 

Detailed Description

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

A map wrapper that allows using UniquePersistent as a mapped value. C++11 embedders don't need this class, as they can use UniquePersistent 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 141 of file v8-util.h.

Constructor & Destructor Documentation

V8_INLINE PersistentValueMap ( Isolate isolate)
inlineexplicit

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

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

References PersistentValueMap< K, V, Traits >::Clear().

Member Function Documentation

void Clear ( )
inline

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

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

Referenced by PersistentValueMap< K, V, Traits >::~PersistentValueMap().

V8_INLINE bool Contains ( const K &  key)
inline

Check whether a value is contained in the map.

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

V8_INLINE Local<V> Get ( const K &  key)
inline

Get value stored in map.

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

References Local< T >::New().

V8_INLINE Isolate* GetIsolate ( )
inline

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

Referenced by PersistentValueMap< K, V, Traits >::SetReference().

V8_INLINE bool IsWeak ( )
inline

Return whether the map holds weak persistents.

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

V8_INLINE UniquePersistent<V> Remove ( const K &  key)
inline

Return value for key and remove it from the map.

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

UniquePersistent<V> Set ( const K &  key,
Local< V >  value 
)
inline

Put value into map. Depending on Traits::kIsWeak, the value will be held by the map strongly or weakly. Returns old value as UniquePersistent.

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

UniquePersistent<V> Set ( const K &  key,
UniquePersistent< V >  value 
)
inline

Put value into map, like Set(const K&, Local<V>).

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

V8_INLINE void SetReference ( const K &  key,
const Persistent< Object > &  parent 
)
inline

Call Isolate::SetReference with the given parent and the map value.

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

References PersistentValueMap< K, V, Traits >::GetIsolate(), and Isolate::SetReference().

V8_INLINE bool 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 177 of file v8-util.h.

V8_INLINE size_t Size ( )
inline

Return size of the map.

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


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