V8 API Reference Guide generated from the header files
Public Member Functions
v8::PersistentValueVector< V, Traits > Class Template Reference

#include <v8-util.h>

Public Member Functions

 PersistentValueVector (Isolate *isolate)
 
void Append (Local< V > value)
 
void Append (Global< V > persistent)
 
bool IsEmpty () const
 
size_t Size () const
 
Local< V > Get (size_t index) const
 
void Clear ()
 
void ReserveCapacity (size_t capacity)
 

Detailed Description

template<typename V, typename Traits = DefaultPersistentValueVectorTraits>
class v8::PersistentValueVector< V, Traits >

A vector wrapper that safely stores Global values. C++11 embedders don't need this class, as they can use Global directly in std containers.

This class relies on a backing vector implementation, whose type and methods 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.

Member Function Documentation

◆ Append() [1/2]

template<typename V , typename Traits = DefaultPersistentValueVectorTraits>
void v8::PersistentValueVector< V, Traits >::Append ( Local< V >  value)
inline

Append a value to the vector.

◆ Append() [2/2]

template<typename V , typename Traits = DefaultPersistentValueVectorTraits>
void v8::PersistentValueVector< V, Traits >::Append ( Global< V >  persistent)
inline

Append a persistent's value to the vector.

◆ Clear()

template<typename V , typename Traits = DefaultPersistentValueVectorTraits>
void v8::PersistentValueVector< V, Traits >::Clear ( )
inline

Remove all elements from the vector.

◆ Get()

template<typename V , typename Traits = DefaultPersistentValueVectorTraits>
Local<V> v8::PersistentValueVector< V, Traits >::Get ( size_t  index) const
inline

Retrieve the i-th value in the vector.

◆ IsEmpty()

template<typename V , typename Traits = DefaultPersistentValueVectorTraits>
bool v8::PersistentValueVector< V, Traits >::IsEmpty ( ) const
inline

Are there any values in the vector?

◆ ReserveCapacity()

template<typename V , typename Traits = DefaultPersistentValueVectorTraits>
void v8::PersistentValueVector< V, Traits >::ReserveCapacity ( size_t  capacity)
inline

Reserve capacity in the vector. (Efficiency gains depend on the backing implementation.)

◆ Size()

template<typename V , typename Traits = DefaultPersistentValueVectorTraits>
size_t v8::PersistentValueVector< V, Traits >::Size ( ) const
inline

How many elements are in the vector?


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