Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NavigationHistoryPool Class Reference

#include <G4NavigationHistoryPool.hh>

Public Member Functions

std::vector< G4NavigationLevel > * GetNewLevels ()
 
std::vector< G4NavigationLevel > * GetLevels ()
 
void DeRegister (std::vector< G4NavigationLevel > *pLevels)
 
void Clean ()
 
void Print () const
 
 ~G4NavigationHistoryPool ()
 

Static Public Member Functions

static G4NavigationHistoryPoolGetInstance ()
 

Detailed Description

Definition at line 43 of file G4NavigationHistoryPool.hh.

Constructor & Destructor Documentation

◆ ~G4NavigationHistoryPool()

G4NavigationHistoryPool::~G4NavigationHistoryPool ( )

Definition at line 57 of file G4NavigationHistoryPool.cc.

58{
59 Clean(); fgInstance = nullptr;
60}

Member Function Documentation

◆ Clean()

void G4NavigationHistoryPool::Clean ( )

Definition at line 66 of file G4NavigationHistoryPool.cc.

67{
68 for(auto & i : fPool)
69 {
70 delete i;
71 }
72 fPool.clear();
73 fFree.clear();
74}

Referenced by ~G4NavigationHistoryPool().

◆ DeRegister()

void G4NavigationHistoryPool::DeRegister ( std::vector< G4NavigationLevel > * pLevels)
inline

Definition at line 102 of file G4NavigationHistoryPool.hh.

104{
105 fFree.push_back(pLevels);
106}

Referenced by G4NavigationHistory::~G4NavigationHistory().

◆ GetInstance()

G4NavigationHistoryPool * G4NavigationHistoryPool::GetInstance ( )
static

◆ GetLevels()

std::vector< G4NavigationLevel > * G4NavigationHistoryPool::GetLevels ( )
inline

Definition at line 125 of file G4NavigationHistoryPool.hh.

126{
127 std::vector<G4NavigationLevel> * levels = nullptr;
128
129 if (!fFree.empty())
130 {
131 levels = fFree.back();
132 fFree.pop_back();
133 }
134 else
135 {
136 levels = GetNewLevels();
137 }
138
139 return levels;
140}
std::vector< G4NavigationLevel > * GetNewLevels()

Referenced by G4NavigationHistory::G4NavigationHistory(), and G4NavigationHistory::G4NavigationHistory().

◆ GetNewLevels()

std::vector< G4NavigationLevel > * G4NavigationHistoryPool::GetNewLevels ( )
inline

Definition at line 112 of file G4NavigationHistoryPool.hh.

113{
114 auto aLevelVec = new std::vector<G4NavigationLevel>(kHistoryMax);
115 Register(aLevelVec);
116
117 return aLevelVec;
118}

Referenced by GetLevels().

◆ Print()

void G4NavigationHistoryPool::Print ( ) const

Definition at line 80 of file G4NavigationHistoryPool.cc.

81{
82#ifdef G4VERBOSE
83 G4cout << "Total navigation history collections cleaned: "
84 << fPool.size() << G4endl;
85#endif
86}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

Referenced by G4RunManagerKernel::~G4RunManagerKernel().


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