Geant4 10.7.0
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(size_t i=0; i<fPool.size(); ++i)
69 {
70 delete fPool[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

Definition at line 108 of file G4NavigationHistoryPool.cc.

109{
110 if (fgInstance == nullptr)
111 {
112 fgInstance = new G4NavigationHistoryPool;
113 }
114 return fgInstance;
115}

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

◆ GetLevels()

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

Definition at line 126 of file G4NavigationHistoryPool.hh.

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

Referenced by G4NavigationHistory::G4NavigationHistory().

◆ GetNewLevels()

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

Definition at line 112 of file G4NavigationHistoryPool.hh.

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

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:57
G4GLOB_DLL std::ostream G4cout

Referenced by G4RunManagerKernel::~G4RunManagerKernel().


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