v8  3.28.71 (node 0.12.18)
V8 is Google's open source JavaScript engine
PersistentValueVector< V, Traits > Class Template Reference

#include <v8-util.h>

Public Member Functions

 PersistentValueVector (Isolate *isolate)
 
 ~PersistentValueVector ()
 
void Append (Local< V > value)
 
void Append (UniquePersistent< 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 UniquePersistent values. C++11 embedders don't need this class, as they can use UniquePersistent 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.

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

Constructor & Destructor Documentation

◆ PersistentValueVector()

PersistentValueVector ( Isolate isolate)
inlineexplicit

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

◆ ~PersistentValueVector()

~PersistentValueVector ( )
inline

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

References PersistentValueVector< V, Traits >::Clear().

Member Function Documentation

◆ Append() [1/2]

void Append ( Local< V >  value)
inline

Append a value to the vector.

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

References PersistentBase< T >::UniquePersistent.

◆ Append() [2/2]

void Append ( UniquePersistent< V >  persistent)
inline

Append a persistent's value to the vector.

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

◆ Clear()

void Clear ( )
inline

Remove all elements from the vector.

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

References PersistentBase< T >::UniquePersistent.

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

◆ Get()

Local<V> Get ( size_t  index) const
inline

Retrieve the i-th value in the vector.

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

References Handle< T >::Local.

◆ IsEmpty()

bool IsEmpty ( ) const
inline

Are there any values in the vector?

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

◆ ReserveCapacity()

void ReserveCapacity ( size_t  capacity)
inline

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

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

◆ Size()

size_t Size ( ) const
inline

How many elements are in the vector?

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


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