GCC Middle and Back End API Reference
auto_delete_vec< T > Class Template Reference

#include <vec.h>

Inheritance diagram for auto_delete_vec< T >:
Collaboration diagram for auto_delete_vec< T >:

Public Member Functions

 auto_delete_vec ()
 
 auto_delete_vec (size_t s)
 
 ~auto_delete_vec ()
 
vec< T, va_heapto_vec_legacy ()
 

Private Member Functions

 DISABLE_COPY_AND_ASSIGN (auto_delete_vec)
 

Private Attributes

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

Detailed Description

template<typename T>
class auto_delete_vec< T >
A subclass of auto_vec <T *> that deletes all of its elements on
destruction.

This is a crude way for a vec to "own" the objects it points to
and clean up automatically.

For example, no attempt is made to delete elements when an item
within the vec is overwritten.

We can't rely on gnu::unique_ptr within a container,
since we can't rely on move semantics in C++98.   

Constructor & Destructor Documentation

◆ auto_delete_vec() [1/2]

template<typename T >
auto_delete_vec< T >::auto_delete_vec ( )
inline

◆ auto_delete_vec() [2/2]

template<typename T >
auto_delete_vec< T >::auto_delete_vec ( size_t s)
inline

◆ ~auto_delete_vec()

template<typename T >
auto_delete_vec< T >::~auto_delete_vec ( )
inline
auto_delete_vec's dtor, deleting all contained items, automatically
chaining up to ~auto_vec <T*>, which frees the internal buffer.   

References FOR_EACH_VEC_ELT, and i.

Member Function Documentation

◆ DISABLE_COPY_AND_ASSIGN()

template<typename T >
auto_delete_vec< T >::DISABLE_COPY_AND_ASSIGN ( auto_delete_vec< T > )
private

◆ to_vec_legacy()

vec< T, va_heap > auto_vec< T, N >::to_vec_legacy ( )
inlineinherited

Field Documentation

◆ m_auto

vec<T, va_heap, vl_embed> auto_vec< T, N >::m_auto
privateinherited

◆ m_data

unsigned char auto_vec< T, N >::m_data[sizeof(T) *N]
privateinherited

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