Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 ( )

Definition at line 46 of file G4MoleculeHandleManager.cc.

47 {
48  if (fMoleculeHandle.empty() == false)
49  {
50  MoleculeHandleMap::iterator it = fMoleculeHandle.begin();
51  for (; it != fMoleculeHandle.end(); it++)
52  {
53  it->second.reset();
54  }
55  }
56 }

Member Function Documentation

void G4MoleculeHandleManager::DeleteInstance ( )
static

Definition at line 58 of file G4MoleculeHandleManager.cc.

59 {
60  if (fInstance)
61  {
62  delete fInstance;
63  fInstance = 0;
64  }
65 }
G4MoleculeHandle G4MoleculeHandleManager::GetMoleculeHandle ( const G4Molecule molecule)

Definition at line 76 of file G4MoleculeHandleManager.cc.

77 {
78  MoleculeHandleMap::iterator it = fMoleculeHandle.find(molecule);
79  G4MoleculeHandle molHandle;
80 
81  if (it != fMoleculeHandle.end())
82  {
83  molHandle = G4MoleculeHandle(it->second);
84  }
85  else
86  {
87  molHandle = G4MoleculeHandle(molecule);
88  fMoleculeHandle.insert(make_pair(molecule, G4MoleculeHandle(molHandle)));
89  }
90 
91  return molHandle;
92 }
G4shared_ptr< const G4Molecule > G4MoleculeHandle
G4MoleculeHandleManager * G4MoleculeHandleManager::Instance ( )
static

Definition at line 67 of file G4MoleculeHandleManager.cc.

68 {
69  if (!fInstance)
70  {
71  fInstance = new G4MoleculeHandleManager;
72  }
73  return fInstance;
74 }

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