PandaRoot
PndFTSArray< T, Dim > Class Template Reference

#include <PndFTSArray.h>

Inheritance diagram for PndFTSArray< T, Dim >:
PndFTSInternal::ArrayBase< T, Dim >

Public Types

typedef PndFTSInternal::ArrayBase< T, Dim > Parent
 

Public Member Functions

int Size () const
 
 operator bool () const
 
bool IsValid () const
 
T & operator* ()
 
const T & operator* () const
 
T * Data ()
 
const T * Data () const
 
PndFTSArray operator+ (int x) const
 
PndFTSArray operator- (int x) const
 
template<typename Other >
PndFTSArray< Other, Dim > ReinterpretCast () const
 

Detailed Description

template<typename T, int Dim = 1>
class PndFTSArray< T, Dim >

C-Array like class with the dimension dependent behavior defined in the ArrayBase class

Definition at line 76 of file PndFTSArray.h.

Member Typedef Documentation

◆ Parent

template<typename T, int Dim = 1>
typedef PndFTSInternal::ArrayBase<T, Dim> PndFTSArray< T, Dim >::Parent

Definition at line 480 of file PndFTSArray.h.

Member Function Documentation

◆ Data() [1/2]

template<typename T, int Dim = 1>
T* PndFTSArray< T, Dim >::Data ( )
inline

returns a pointer to the data This circumvents bounds checking so it should not be used.

Definition at line 518 of file PndFTSArray.h.

Referenced by PndFTSCAGBTracker::Hits().

518 { return Parent::fData; }

◆ Data() [2/2]

template<typename T, int Dim = 1>
const T* PndFTSArray< T, Dim >::Data ( ) const
inline

returns a const pointer to the data This circumvents bounds checking so it should not be used.

Definition at line 523 of file PndFTSArray.h.

523 { return Parent::fData; }

◆ IsValid()

template<typename T, int Dim = 1>
bool PndFTSArray< T, Dim >::IsValid ( ) const
inline

allows you to check for validity of the array

Definition at line 495 of file PndFTSArray.h.

495 { return Parent::fData != 0; }

◆ operator bool()

template<typename T, int Dim = 1>
PndFTSArray< T, Dim >::operator bool ( ) const
inline

allows you to check for validity of the array by casting to bool

Definition at line 491 of file PndFTSArray.h.

491 { return Parent::fData != 0; }

◆ operator*() [1/2]

template<typename T, int Dim = 1>
T& PndFTSArray< T, Dim >::operator* ( )
inline

returns a reference to the data at index 0

Definition at line 500 of file PndFTSArray.h.

501  {
502  BOUNDS_CHECK(0, Parent::fData[0]);
503  return *Parent::fData;
504  }
#define BOUNDS_CHECK(x, y)
Definition: PndFTSArray.h:134

◆ operator*() [2/2]

template<typename T, int Dim = 1>
const T& PndFTSArray< T, Dim >::operator* ( ) const
inline

returns a const reference to the data at index 0

Definition at line 508 of file PndFTSArray.h.

509  {
510  BOUNDS_CHECK(0, Parent::fData[0]);
511  return *Parent::fData;
512  }
#define BOUNDS_CHECK(x, y)
Definition: PndFTSArray.h:134

◆ operator+()

template<typename T , int Dim>
PndFTSArray< T, Dim > PndFTSArray< T, Dim >::operator+ ( int  x) const
inline

moves the array base pointer so that the data that was once at index 0 will then be at index -x

Definition at line 764 of file PndFTSArray.h.

765 {
766  PndFTSArray<T, Dim> r(*this);
767  r.fData += x;
768  r.MoveBounds(-x);
769  return r;
770 }

◆ operator-()

template<typename T , int Dim>
PndFTSArray< T, Dim > PndFTSArray< T, Dim >::operator- ( int  x) const
inline

moves the array base pointer so that the data that was once at index 0 will then be at index x

Definition at line 772 of file PndFTSArray.h.

773 {
774  PndFTSArray<T, Dim> r(*this);
775  r.fData -= x;
776  r.MoveBounds(x);
777  return r;
778 }

◆ ReinterpretCast()

template<typename T, int Dim = 1>
template<typename Other >
PndFTSArray<Other, Dim> PndFTSArray< T, Dim >::ReinterpretCast ( ) const
inline

Definition at line 535 of file PndFTSArray.h.

Referenced by PndFTSArray< PndFTSInternal::TypeForAlignmentHelper< PndFTSCAGBHit, 0 >::Type, 1 >::ReinterpretCast().

536  {
538  r.fData = reinterpret_cast<Other *>(Parent::fData);
539  r.ReinterpretCast(*this, sizeof(T), sizeof(Other));
540  }
PndFTSArray< Other, Dim > ReinterpretCast() const
Definition: PndFTSArray.h:535

◆ Size()

template<typename T, int Dim = 1>
int PndFTSArray< T, Dim >::Size ( ) const
inline

Returns the number of elements in the array. If it is a multi-dimensional array the size is the multiplication of the dimensions ( e.g. a 10 x 20 array returns 200 as its size ).

Definition at line 486 of file PndFTSArray.h.

Referenced by PndFTSCAGBTracker::GetHitsSize().

486 { return Parent::fSize; }

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