PandaRoot
PndCAFixedArray< T, Size, alignment > Class Template Reference

#include <PndCAArray.h>

Inheritance diagram for PndCAFixedArray< T, Size, alignment >:
PndCAArray< PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type, Size::Dim > PndCAInternal::ArrayBase< PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type, Dim >

Public Types

typedef PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type T2
 
typedef PndCAInternal::ArrayBase< T2, Size::Dim > Parent
 
- Public Types inherited from PndCAArray< PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type, Size::Dim >
typedef PndCAInternal::ArrayBase< PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type, Dim > Parent
 

Public Member Functions

 PndCAFixedArray ()
 
 PndCAFixedArray (const PndCAFixedArray &rhs)
 
- Public Member Functions inherited from PndCAArray< PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type, Size::Dim >
int Size () const
 
 operator bool () const
 
bool IsValid () const
 
PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type & operator* ()
 
const PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type & operator* () const
 
PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type * Data ()
 
const PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type * Data () const
 
PndCAArray operator+ (int x) const
 
PndCAArray operator- (int x) const
 
PndCAArray< Other, Dim > ReinterpretCast () const
 

Detailed Description

template<typename T, typename Size, int alignment = 0>
class PndCAFixedArray< T, Size, alignment >

Owns the data. When it goes out of scope the data is freed.

The memory is allocated on the stack.

Instantiate this class on the stack.

Parameters
Ttype of the entries in the array.
Sizenumber of entries in the array.
Dimselects the operator[]/operator() behavior it should have. I.e. makes it behave like a 1-, 2- or 3-dim array. (defaults to 1)

Definition at line 665 of file PndCAArray.h.

Member Typedef Documentation

◆ Parent

template<typename T , typename Size , int alignment = 0>
typedef PndCAInternal::ArrayBase<T2, Size::Dim> PndCAFixedArray< T, Size, alignment >::Parent

Definition at line 668 of file PndCAArray.h.

◆ T2

template<typename T , typename Size , int alignment = 0>
typedef PndCAInternal::TypeForAlignmentHelper<T, alignment>::Type PndCAFixedArray< T, Size, alignment >::T2

Definition at line 667 of file PndCAArray.h.

Constructor & Destructor Documentation

◆ PndCAFixedArray() [1/2]

template<typename T , typename Size , int alignment = 0>
PndCAFixedArray< T, Size, alignment >::PndCAFixedArray ( )
inline

Definition at line 669 of file PndCAArray.h.

670  {
671  fData = fFixedArray.ConstructAlignedData();
672  Parent::SetBounds(0, Size::Size - 1);
673  SetSize(Size::X, Size::Y, Size::Z);
674  }

◆ PndCAFixedArray() [2/2]

template<typename T , typename Size , int alignment = 0>
PndCAFixedArray< T, Size, alignment >::PndCAFixedArray ( const PndCAFixedArray< T, Size, alignment > &  rhs)
inline

Definition at line 675 of file PndCAArray.h.

676  {
677  fData = fFixedArray.ConstructAlignedData();
678  Parent::SetBounds(0, Size::Size - 1);
679  SetSize(Size::X, Size::Y, Size::Z);
680  std::memcpy(fData, rhs.fData, Size::Size * sizeof(T));
681  }

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