Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FastVector< Type, N > Class Template Reference

#include <G4FastVector.hh>

Public Member Functions

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

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]; }

◆ ~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 }

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 }
#define N
Definition: crc32.c:56

◆ 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 }

◆ SetElement()

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

Definition at line 72 of file G4FastVector.hh.

75 {
76 ptr[anIndex] = anElement;
77 }

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