FairRoot/PandaRoot
Public Types | Public Member Functions | List of all members
PndCAArray< T, Dim > Class Template Reference

#include <PndCAArray.h>

Inheritance diagram for PndCAArray< T, Dim >:
PndCAInternal::ArrayBase< T, Dim >

Public Types

typedef
PndCAInternal::ArrayBase< T,
Dim > 
Parent
 

Public Member Functions

int Size () const
 
 operator bool () const
 
bool IsValid () const
 
Toperator* ()
 
const Toperator* () const
 
TData ()
 
const TData () const
 
PndCAArray operator+ (int x) const
 
PndCAArray operator- (int x) const
 
template<typename Other >
PndCAArray< Other, Dim > ReinterpretCast () const
 

Detailed Description

template<typename T, int Dim>
class PndCAArray< T, Dim >

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

Definition at line 73 of file PndCAArray.h.

Member Typedef Documentation

template<typename T, int Dim>
typedef PndCAInternal::ArrayBase<T, Dim> PndCAArray< T, Dim >::Parent

Definition at line 368 of file PndCAArray.h.

Member Function Documentation

template<typename T, int Dim>
T* PndCAArray< T, Dim >::Data ( )
inline

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

Definition at line 398 of file PndCAArray.h.

398 { return Parent::fData; }
template<typename T, int Dim>
const T* PndCAArray< 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 403 of file PndCAArray.h.

403 { return Parent::fData; }
template<typename T, int Dim>
bool PndCAArray< T, Dim >::IsValid ( ) const
inline

allows you to check for validity of the array

Definition at line 383 of file PndCAArray.h.

383 { return Parent::fData != 0; }
template<typename T, int Dim>
PndCAArray< T, Dim >::operator bool ( ) const
inline

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

Definition at line 379 of file PndCAArray.h.

379 { return Parent::fData != 0; }
template<typename T, int Dim>
T& PndCAArray< T, Dim >::operator* ( )
inline

returns a reference to the data at index 0

Definition at line 388 of file PndCAArray.h.

388 { BOUNDS_CHECK( 0, Parent::fData[0] ); return *Parent::fData; }
#define BOUNDS_CHECK(x, y)
Definition: PndCAArray.h:118
template<typename T, int Dim>
const T& PndCAArray< T, Dim >::operator* ( ) const
inline

returns a const reference to the data at index 0

Definition at line 392 of file PndCAArray.h.

392 { BOUNDS_CHECK( 0, Parent::fData[0] ); return *Parent::fData; }
#define BOUNDS_CHECK(x, y)
Definition: PndCAArray.h:118
template<typename T , int Dim>
PndCAArray< T, Dim > PndCAArray< 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 654 of file PndCAArray.h.

References r, and x.

655 {
656  PndCAArray<T, Dim> r( *this );
657  r.fData += x;
658  r.MoveBounds( -x );
659  return r;
660 }
double r
Definition: RiemannTest.C:14
Double_t x
template<typename T , int Dim>
PndCAArray< T, Dim > PndCAArray< 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 662 of file PndCAArray.h.

References r, and x.

663 {
664  PndCAArray<T, Dim> r( *this );
665  r.fData -= x;
666  r.MoveBounds( x );
667  return r;
668 }
double r
Definition: RiemannTest.C:14
Double_t x
template<typename T, int Dim>
template<typename Other >
PndCAArray<Other, Dim> PndCAArray< T, Dim >::ReinterpretCast ( ) const
inline

Definition at line 414 of file PndCAArray.h.

Referenced by PndCAArray< PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type, Size::Dim >::ReinterpretCast().

414  {
416  r.fData = reinterpret_cast<Other *>( Parent::fData );
417  r.ReinterpretCast( *this, sizeof( T ), sizeof( Other ) );
418  }
double r
Definition: RiemannTest.C:14
PndCAArray< Other, Dim > ReinterpretCast() const
Definition: PndCAArray.h:414
TTree * T
Definition: anaLmdReco.C:32
template<typename T, int Dim>
int PndCAArray< 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 374 of file PndCAArray.h.

374 { return Parent::fSize; }

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