Blender V5.0
array< T, alignment > Class Template Reference

#include <array.h>

Public Member Functions

 array ()
 array (const size_t newsize)
 array (const array &from)
 array (array &&from)
arrayoperator= (const array &from)
arrayoperator= (const vector< T > &from)
 ~array ()
bool operator== (const array< T > &other) const
bool operator!= (const array< T > &other) const
void steal_data (array &from)
void set_data (T *ptr_, size_t datasize)
Tsteal_pointer ()
Tresize (const size_t newsize)
Tresize (const size_t newsize, const T &value)
void clear ()
size_t empty () const
size_t size () const
Tdata ()
const Tdata () const
Toperator[] (size_t i) const
Tbegin ()
const Tbegin () const
Tend ()
const Tend () const
void reserve (const size_t newcapacity)
size_t capacity () const
void push_back_slow (const T &t)
void push_back_reserved (const T &t)
void append (const array< T > &from)

Protected Member Functions

Tmem_allocate (const size_t N)
void mem_free (T *mem, const size_t N)
void mem_copy (T *mem_to, const T *mem_from, const size_t N)

Protected Attributes

Tdata_
size_t datasize_
size_t capacity_

Detailed Description

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
class array< T, alignment >

Definition at line 22 of file cycles/util/array.h.

Constructor & Destructor Documentation

◆ array() [1/4]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
array< T, alignment >::array ( )
inline

◆ array() [2/4]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
array< T, alignment >::array ( const size_t newsize)
inlineexplicit

Definition at line 26 of file cycles/util/array.h.

References capacity_, data_, datasize_, and mem_allocate().

◆ array() [3/4]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
array< T, alignment >::array ( const array< T, alignment > & from)
inline

Definition at line 40 of file cycles/util/array.h.

References array(), capacity_, data_, datasize_, mem_allocate(), and mem_copy().

◆ array() [4/4]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
array< T, alignment >::array ( array< T, alignment > && from)
inline

Definition at line 57 of file cycles/util/array.h.

References array(), capacity_, data_, and datasize_.

◆ ~array()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
array< T, alignment >::~array ( )
inline

Definition at line 91 of file cycles/util/array.h.

References capacity_, data_, and mem_free().

Member Function Documentation

◆ append()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
void array< T, alignment >::append ( const array< T > & from)
inline

◆ begin() [1/2]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
T * array< T, alignment >::begin ( )
inline

◆ begin() [2/2]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
const T * array< T, alignment >::begin ( ) const
inline

Definition at line 222 of file cycles/util/array.h.

References data_, and T.

◆ capacity()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
size_t array< T, alignment >::capacity ( ) const
inline

Definition at line 250 of file cycles/util/array.h.

References capacity_.

◆ clear()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
void array< T, alignment >::clear ( )
inline

◆ data() [1/2]

◆ data() [2/2]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
const T * array< T, alignment >::data ( ) const
inline

Definition at line 206 of file cycles/util/array.h.

References data_, and T.

◆ empty()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
size_t array< T, alignment >::empty ( ) const
inline

Definition at line 191 of file cycles/util/array.h.

References datasize_.

◆ end() [1/2]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
T * array< T, alignment >::end ( )
inline

◆ end() [2/2]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
const T * array< T, alignment >::end ( ) const
inline

Definition at line 232 of file cycles/util/array.h.

References data_, datasize_, and T.

◆ mem_allocate()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
T * array< T, alignment >::mem_allocate ( const size_t N)
inlineprotected

Definition at line 281 of file cycles/util/array.h.

References N, T, and util_aligned_malloc().

Referenced by array(), array(), reserve(), and resize().

◆ mem_copy()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
void array< T, alignment >::mem_copy ( T * mem_to,
const T * mem_from,
const size_t N )
inlineprotected

Definition at line 300 of file cycles/util/array.h.

References N, and T.

Referenced by append(), array(), operator=(), operator=(), reserve(), and resize().

◆ mem_free()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
void array< T, alignment >::mem_free ( T * mem,
const size_t N )
inlineprotected

Definition at line 293 of file cycles/util/array.h.

References N, T, and util_aligned_free().

Referenced by clear(), reserve(), resize(), and ~array().

◆ operator!=()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
bool array< T, alignment >::operator!= ( const array< T > & other) const
inline

Definition at line 108 of file cycles/util/array.h.

References array().

◆ operator=() [1/2]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
array & array< T, alignment >::operator= ( const array< T, alignment > & from)
inline

Definition at line 68 of file cycles/util/array.h.

References array(), data_, datasize_, mem_copy(), resize(), and size().

◆ operator=() [2/2]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
array & array< T, alignment >::operator= ( const vector< T > & from)
inline

Definition at line 80 of file cycles/util/array.h.

References array(), data_, datasize_, mem_copy(), and resize().

◆ operator==()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
bool array< T, alignment >::operator== ( const array< T > & other) const
inline

Definition at line 96 of file cycles/util/array.h.

References array(), data_, datasize_, and T.

◆ operator[]()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
T & array< T, alignment >::operator[] ( size_t i) const
inline

Definition at line 211 of file cycles/util/array.h.

References assert, data_, datasize_, i, and T.

◆ push_back_reserved()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
void array< T, alignment >::push_back_reserved ( const T & t)
inline

Definition at line 265 of file cycles/util/array.h.

References assert, capacity_, datasize_, push_back_slow(), and T.

◆ push_back_slow()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
void array< T, alignment >::push_back_slow ( const T & t)
inline

◆ reserve()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
void array< T, alignment >::reserve ( const size_t newcapacity)
inline

◆ resize() [1/2]

◆ resize() [2/2]

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
T * array< T, alignment >::resize ( const size_t newsize,
const T & value )
inline

Definition at line 169 of file cycles/util/array.h.

References data_, i, resize(), size(), and T.

◆ set_data()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
void array< T, alignment >::set_data ( T * ptr_,
size_t datasize )
inline

Definition at line 128 of file cycles/util/array.h.

References capacity_, clear(), data_, datasize_, and T.

◆ size()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
size_t array< T, alignment >::size ( ) const
inline

◆ steal_data()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
void array< T, alignment >::steal_data ( array< T, alignment > & from)
inline

Definition at line 113 of file cycles/util/array.h.

References array(), capacity_, clear(), data_, and datasize_.

◆ steal_pointer()

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
T * array< T, alignment >::steal_pointer ( )
inline

Definition at line 136 of file cycles/util/array.h.

References clear(), data_, ptr, and T.

Referenced by device_vector< T >::steal_data().

Member Data Documentation

◆ capacity_

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
size_t array< T, alignment >::capacity_
protected

◆ data_

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
T* array< T, alignment >::data_
protected

◆ datasize_

template<typename T, const size_t alignment = MIN_ALIGNMENT_CPU_DATA_TYPES>
size_t array< T, alignment >::datasize_
protected

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