GCC Middle and Back End API Reference
auto_vec< T, N > Class Template Reference

#include <vec.h>

Inherits vec< T, va_heap >.

Inherited by auto_delete_vec< node_t >, auto_delete_vec< edge_t >, auto_delete_vec< ana::bar_chart::item >, auto_delete_vec< ana::checker_event >, auto_delete_vec< ana::equiv_class >, auto_delete_vec< ana::saved_diagnostic >, auto_delete_vec< ana::state_machine >, auto_delete_vec< ana::sm_state_map >, auto_delete_vec< ana::svalue >, auto_delete_vec< ana::region >, auto_delete_vec< ana::pending_note >, auto_delete_vec< ana::state_machine::state >, auto_delete_vec< simple_diagnostic_thread >, auto_delete_vec< simple_diagnostic_event >, vector_builder< rtx, machine_mode, rtx_vector_builder >, vector_builder< tree, tree, tree_vector_builder >, and vector_builder< poly_int64, poly_uint64, int_vector_builder< poly_int64 > >.

Collaboration diagram for auto_vec< T, N >:

Public Member Functions

 auto_vec ()
 
 auto_vec (size_t s CXX_MEM_STAT_INFO)
 
 ~auto_vec ()
 
vec< T, va_heapto_vec_legacy ()
 

Private Attributes

vec< T, va_heap, vl_embedm_auto
 
unsigned char m_data [sizeof(T) *N]
 

Detailed Description

template<typename T, size_t N>
class auto_vec< T, N >
Space efficient vector.  These vectors can grow dynamically and are
allocated together with their control data.  They are suited to be
included in data structures.  Prior to initial allocation, they
only take a single word of storage.

These vectors are implemented as a pointer to an embeddable vector.
The semantics allow for this pointer to be NULL to represent empty
vectors.  This way, empty vectors occupy minimal space in the
structure containing them.

Properties:

     - The whole vector and control data are allocated in a single
       contiguous block.
     - The whole vector may be re-allocated.
     - Vector data may grow and shrink.
     - Access and manipulation requires a pointer test and
       indirection.
     - It requires 1 word of storage (prior to vector allocation).


Limitations:

These vectors must be PODs because they are stored in unions.
(http://en.wikipedia.org/wiki/Plain_old_data_structures).
As long as we use C++03, we cannot have constructors nor
destructors in classes that are stored in unions.   
auto_vec is a subclass of vec that automatically manages creating and
releasing the internal vector. If N is non zero then it has N elements of
internal storage.  The default is no internal storage, and you probably only
want to ask for internal storage for vectors on the stack because if the
size of the vector is larger than the internal storage that space is wasted.

Constructor & Destructor Documentation

◆ auto_vec() [1/2]

template<typename T , size_t N>
auto_vec< T, N >::auto_vec ( )
inline

References auto_vec< T, N >::m_auto, and N.

◆ auto_vec() [2/2]

template<typename T , size_t N>
auto_vec< T, N >::auto_vec ( size_t s CXX_MEM_STAT_INFO)
inline

◆ ~auto_vec()

template<typename T , size_t N>
auto_vec< T, N >::~auto_vec ( )
inline

Member Function Documentation

◆ to_vec_legacy()

template<typename T , size_t N>
vec< T, va_heap > auto_vec< T, N >::to_vec_legacy ( )
inline

Field Documentation

◆ m_auto

template<typename T , size_t N>
vec<T, va_heap, vl_embed> auto_vec< T, N >::m_auto
private

◆ m_data

template<typename T , size_t N>
unsigned char auto_vec< T, N >::m_data[sizeof(T) *N]
private

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