Geant4-11
Public Member Functions | Private Attributes
G4FastVector< Type, N > Class Template Reference

#include <G4FastVector.hh>

Public Member Functions

 G4FastVector ()
 
void Initialize (G4int items)
 
Typeoperator[] (G4int anIndex) const
 
void SetElement (G4int anIndex, Type *anElement)
 
 ~G4FastVector ()
 

Private Attributes

Type ** ptr
 
TypetheArray [N]
 

Detailed Description

template<class Type, G4int N>
class G4FastVector< Type, N >

Definition at line 42 of file G4FastVector.hh.

Constructor & Destructor Documentation

◆ G4FastVector()

template<class Type , G4int N>
G4FastVector< Type, N >::G4FastVector ( )
inline

Definition at line 45 of file G4FastVector.hh.

45{ ptr = &theArray[0]; }
Type * theArray[N]
Definition: G4FastVector.hh:80

References G4FastVector< Type, N >::ptr, and G4FastVector< Type, N >::theArray.

◆ ~G4FastVector()

template<class Type , G4int N>
G4FastVector< Type, N >::~G4FastVector ( )
inline

Definition at line 47 of file G4FastVector.hh.

48 {
49 if(ptr != &theArray[0])
50 delete[] ptr;
51 }

References G4FastVector< Type, N >::ptr, and G4FastVector< Type, N >::theArray.

Member Function Documentation

◆ Initialize()

template<class Type , G4int N>
void G4FastVector< Type, N >::Initialize ( G4int  items)
inline

Definition at line 59 of file G4FastVector.hh.

63 {
64 if(ptr != &theArray[0])
65 delete[] ptr;
66 if(items > N)
67 ptr = new Type*[items];
68 else
69 ptr = &theArray[0];
70 }

References G4FastVector< Type, N >::ptr, and G4FastVector< Type, N >::theArray.

◆ operator[]()

template<class Type , G4int N>
Type * G4FastVector< Type, N >::operator[] ( G4int  anIndex) const
inline

Definition at line 53 of file G4FastVector.hh.

55 {
56 return ptr[anIndex];
57 }

References G4FastVector< Type, N >::ptr.

◆ SetElement()

template<class Type , G4int N>
void G4FastVector< Type, N >::SetElement ( G4int  anIndex,
Type anElement 
)
inline

Field Documentation

◆ ptr

template<class Type , G4int N>
Type** G4FastVector< Type, N >::ptr
private

◆ theArray

template<class Type , G4int N>
Type* G4FastVector< Type, N >::theArray[N]
private

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