v8  6.1.534(node8.9.3)
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 (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.

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

Constructor & Destructor Documentation

PersistentValueVector ( Isolate isolate)

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

~PersistentValueVector ( )

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

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

Member Function Documentation

void Append ( Local< V >  value)

Append a value to the vector.

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

void Append ( Global< V >  persistent)

Append a persistent's value to the vector.

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

void Clear ( )

Remove all elements from the vector.

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

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

Local<V> Get ( size_t  index) const

Retrieve the i-th value in the vector.

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

bool IsEmpty ( ) const

Are there any values in the vector?

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

void ReserveCapacity ( size_t  capacity)

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

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

size_t Size ( ) const

How many elements are in the vector?

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

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