ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GSFUtils::AlignedDynArray< T, ALIGNMENT > Struct Template Reference

A wrapper around std::aligned_alloc. More...

#include <AlignedDynArray.h>

Collaboration diagram for GSFUtils::AlignedDynArray< T, ALIGNMENT >:

Public Types

typedef T value_type
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef value_typeiterator
 
typedef const value_typeconst_iterator
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 

Public Member Functions

 AlignedDynArray ()=delete
 Deleted default constructor. More...
 
 AlignedDynArray (AlignedDynArray const &)=delete
 Deleted default copy constructor. More...
 
AlignedDynArrayoperator= (AlignedDynArray const &)=delete
 Deleted default assignment operator. More...
 
 AlignedDynArray (const size_type n)
 Constructor with default initializing elements. More...
 
 AlignedDynArray (const size_type n, const T &value)
 Constructor initializing elements to value. More...
 
 AlignedDynArray (AlignedDynArray &&) noexcept
 Move copy constructor. More...
 
AlignedDynArrayoperator= (AlignedDynArray &&) noexcept
 Move assignment operator. More...
 
 ~AlignedDynArray ()
 Destructor. More...
 
pointer buffer () noexcept
 Get the underlying buffer. More...
 
const_pointer buffer () const noexcept
 Get the underlying buffer (const) More...
 
reference operator[] (size_type pos) noexcept
 index array operator More...
 
const_reference operator[] (size_type pos) const noexcept
 index array operator (const) More...
 
iterator begin () noexcept
 iterator pointing to the first element More...
 
const_iterator begin () const noexcept
 const iterator pointing to the first element More...
 
iterator end () noexcept
 iterator pointing to the past-the-end element More...
 
const_iterator end () const noexcept
 const iterator pointing to the past-the-end element More...
 
size_type size () const noexcept
 number of elements/size More...
 
bool empty () const noexcept
 returns true is size == 0 More...
 

Private Member Functions

void cleanup ()
 Helper method for calling the dtor for the elements. More...
 

Private Attributes

pointer m_buffer = nullptr
 Pointer to the underlying buffer. More...
 
size_type m_size = 0
 Num of elements/size. More...
 

Detailed Description

template<typename T, size_t ALIGNMENT>
struct GSFUtils::AlignedDynArray< T, ALIGNMENT >

A wrapper around std::aligned_alloc.

The main usage is to create an alligned buffer array to be used with vector instructions

Provides

Definition at line 29 of file AlignedDynArray.h.

Member Typedef Documentation

◆ const_iterator

template<typename T , size_t ALIGNMENT>
typedef const value_type* GSFUtils::AlignedDynArray< T, ALIGNMENT >::const_iterator

Definition at line 53 of file AlignedDynArray.h.

◆ const_pointer

template<typename T , size_t ALIGNMENT>
typedef const T* GSFUtils::AlignedDynArray< T, ALIGNMENT >::const_pointer

Definition at line 49 of file AlignedDynArray.h.

◆ const_reference

template<typename T , size_t ALIGNMENT>
typedef const value_type& GSFUtils::AlignedDynArray< T, ALIGNMENT >::const_reference

Definition at line 51 of file AlignedDynArray.h.

◆ difference_type

template<typename T , size_t ALIGNMENT>
typedef std::ptrdiff_t GSFUtils::AlignedDynArray< T, ALIGNMENT >::difference_type

Definition at line 55 of file AlignedDynArray.h.

◆ iterator

template<typename T , size_t ALIGNMENT>
typedef value_type* GSFUtils::AlignedDynArray< T, ALIGNMENT >::iterator

Definition at line 52 of file AlignedDynArray.h.

◆ pointer

template<typename T , size_t ALIGNMENT>
typedef T* GSFUtils::AlignedDynArray< T, ALIGNMENT >::pointer

Definition at line 48 of file AlignedDynArray.h.

◆ reference

template<typename T , size_t ALIGNMENT>
typedef value_type& GSFUtils::AlignedDynArray< T, ALIGNMENT >::reference

Definition at line 50 of file AlignedDynArray.h.

◆ size_type

template<typename T , size_t ALIGNMENT>
typedef std::size_t GSFUtils::AlignedDynArray< T, ALIGNMENT >::size_type

Definition at line 54 of file AlignedDynArray.h.

◆ value_type

template<typename T , size_t ALIGNMENT>
typedef T GSFUtils::AlignedDynArray< T, ALIGNMENT >::value_type

Definition at line 47 of file AlignedDynArray.h.

Constructor & Destructor Documentation

◆ AlignedDynArray() [1/5]

template<typename T , size_t ALIGNMENT>
GSFUtils::AlignedDynArray< T, ALIGNMENT >::AlignedDynArray ( )
delete

Deleted default constructor.

◆ AlignedDynArray() [2/5]

template<typename T , size_t ALIGNMENT>
GSFUtils::AlignedDynArray< T, ALIGNMENT >::AlignedDynArray ( AlignedDynArray< T, ALIGNMENT > const )
delete

Deleted default copy constructor.

◆ AlignedDynArray() [3/5]

template<typename T , size_t ALIGNMENT>
GSFUtils::AlignedDynArray< T, ALIGNMENT >::AlignedDynArray ( const size_type  n)
explicit

Constructor with default initializing elements.

◆ AlignedDynArray() [4/5]

template<typename T , size_t ALIGNMENT>
GSFUtils::AlignedDynArray< T, ALIGNMENT >::AlignedDynArray ( const size_type  n,
const T &  value 
)
explicit

Constructor initializing elements to value.

◆ AlignedDynArray() [5/5]

template<typename T , size_t ALIGNMENT>
GSFUtils::AlignedDynArray< T, ALIGNMENT >::AlignedDynArray ( AlignedDynArray< T, ALIGNMENT > &&  )
noexcept

Move copy constructor.

◆ ~AlignedDynArray()

template<typename T , size_t ALIGNMENT>
GSFUtils::AlignedDynArray< T, ALIGNMENT >::~AlignedDynArray ( )

Destructor.

Member Function Documentation

◆ begin() [1/2]

template<typename T , size_t ALIGNMENT>
const_iterator GSFUtils::AlignedDynArray< T, ALIGNMENT >::begin ( ) const
noexcept

const iterator pointing to the first element

◆ begin() [2/2]

template<typename T , size_t ALIGNMENT>
iterator GSFUtils::AlignedDynArray< T, ALIGNMENT >::begin ( )
noexcept

iterator pointing to the first element

◆ buffer() [1/2]

template<typename T , size_t ALIGNMENT>
const_pointer GSFUtils::AlignedDynArray< T, ALIGNMENT >::buffer ( ) const
noexcept

Get the underlying buffer (const)

◆ buffer() [2/2]

template<typename T , size_t ALIGNMENT>
pointer GSFUtils::AlignedDynArray< T, ALIGNMENT >::buffer ( )
noexcept

Get the underlying buffer.

◆ cleanup()

template<typename T , size_t ALIGNMENT>
void GSFUtils::AlignedDynArray< T, ALIGNMENT >::cleanup ( )
private

Helper method for calling the dtor for the elements.

◆ empty()

template<typename T , size_t ALIGNMENT>
bool GSFUtils::AlignedDynArray< T, ALIGNMENT >::empty ( ) const
noexcept

returns true is size == 0

◆ end() [1/2]

template<typename T , size_t ALIGNMENT>
const_iterator GSFUtils::AlignedDynArray< T, ALIGNMENT >::end ( ) const
noexcept

const iterator pointing to the past-the-end element

◆ end() [2/2]

template<typename T , size_t ALIGNMENT>
iterator GSFUtils::AlignedDynArray< T, ALIGNMENT >::end ( )
noexcept

iterator pointing to the past-the-end element

◆ operator=() [1/2]

template<typename T , size_t ALIGNMENT>
AlignedDynArray& GSFUtils::AlignedDynArray< T, ALIGNMENT >::operator= ( AlignedDynArray< T, ALIGNMENT > &&  )
noexcept

Move assignment operator.

◆ operator=() [2/2]

template<typename T , size_t ALIGNMENT>
AlignedDynArray& GSFUtils::AlignedDynArray< T, ALIGNMENT >::operator= ( AlignedDynArray< T, ALIGNMENT > const )
delete

Deleted default assignment operator.

◆ operator[]() [1/2]

template<typename T , size_t ALIGNMENT>
const_reference GSFUtils::AlignedDynArray< T, ALIGNMENT >::operator[] ( size_type  pos) const
noexcept

index array operator (const)

◆ operator[]() [2/2]

template<typename T , size_t ALIGNMENT>
reference GSFUtils::AlignedDynArray< T, ALIGNMENT >::operator[] ( size_type  pos)
noexcept

index array operator

◆ size()

template<typename T , size_t ALIGNMENT>
size_type GSFUtils::AlignedDynArray< T, ALIGNMENT >::size ( ) const
noexcept

number of elements/size

Member Data Documentation

◆ m_buffer

template<typename T , size_t ALIGNMENT>
pointer GSFUtils::AlignedDynArray< T, ALIGNMENT >::m_buffer = nullptr
private

Pointer to the underlying buffer.

Definition at line 117 of file AlignedDynArray.h.

◆ m_size

template<typename T , size_t ALIGNMENT>
size_type GSFUtils::AlignedDynArray< T, ALIGNMENT >::m_size = 0
private

Num of elements/size.

Definition at line 120 of file AlignedDynArray.h.


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