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

#include <G4MoleculeHandleManager.hh>

Public Member Functions

 ~G4MoleculeHandleManager ()
 
G4MoleculeHandle GetMoleculeHandle (const G4Molecule *)
 

Static Public Member Functions

static G4MoleculeHandleManagerInstance ()
 
static void DeleteInstance ()
 

Detailed Description

Definition at line 58 of file G4MoleculeHandleManager.hh.

Constructor & Destructor Documentation

◆ ~G4MoleculeHandleManager()

G4MoleculeHandleManager::~G4MoleculeHandleManager ( )

Definition at line 43 of file G4MoleculeHandleManager.cc.

44{
45 if (!fMoleculeHandle.empty())
46 {
47 auto it = fMoleculeHandle.begin();
48 for (; it != fMoleculeHandle.end(); it++)
49 {
50 it->second.reset();
51 }
52 }
53}

Member Function Documentation

◆ DeleteInstance()

void G4MoleculeHandleManager::DeleteInstance ( )
static

Definition at line 55 of file G4MoleculeHandleManager.cc.

56{
57 if (fInstance != nullptr)
58 {
59 delete fInstance;
60 fInstance = nullptr;
61 }
62}

◆ GetMoleculeHandle()

G4MoleculeHandle G4MoleculeHandleManager::GetMoleculeHandle ( const G4Molecule * molecule)

Definition at line 73 of file G4MoleculeHandleManager.cc.

74{
75 auto it = fMoleculeHandle.find(molecule);
76 G4MoleculeHandle molHandle;
77
78 if (it != fMoleculeHandle.end())
79 {
80 molHandle = G4MoleculeHandle(it->second);
81 }
82 else
83 {
84 molHandle = G4MoleculeHandle(molecule);
85 fMoleculeHandle.insert(make_pair(molecule, G4MoleculeHandle(molHandle)));
86 }
87
88 return molHandle;
89}
std::shared_ptr< const G4Molecule > G4MoleculeHandle

◆ Instance()

G4MoleculeHandleManager * G4MoleculeHandleManager::Instance ( )
static

Definition at line 64 of file G4MoleculeHandleManager.cc.

65{
66 if (fInstance == nullptr)
67 {
68 fInstance = new G4MoleculeHandleManager;
69 }
70 return fInstance;
71}

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