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 653 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 656 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 655 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 657 of file PndCAArray.h.

658  {
659  fData = fFixedArray.ConstructAlignedData();
660  Parent::SetBounds(0, Size::Size - 1);
661  SetSize(Size::X, Size::Y, Size::Z);
662  }

◆ 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 663 of file PndCAArray.h.

664  {
665  fData = fFixedArray.ConstructAlignedData();
666  Parent::SetBounds(0, Size::Size - 1);
667  SetSize(Size::X, Size::Y, Size::Z);
668  std::memcpy(fData, rhs.fData, Size::Size * sizeof(T));
669  }

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