Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4GeometryWorkspacePool Class Reference

#include <G4GeometryWorkspacePool.hh>

Public Member Functions

G4GeometryWorkspaceCreateWorkspace ()
 
void CreateAndUseWorkspace ()
 
G4GeometryWorkspaceFindOrCreateWorkspace ()
 
G4GeometryWorkspaceGetWorkspace ()
 
void Recycle (G4GeometryWorkspace *)
 
void CleanUpAndDestroyAllWorkspaces ()
 

Static Public Member Functions

static G4GeometryWorkspacePoolGetInstance ()
 

Protected Member Functions

void ReleaseAndDestroyWorkspace (G4GeometryWorkspace *)
 

Detailed Description

Definition at line 50 of file G4GeometryWorkspacePool.hh.

Member Function Documentation

void G4GeometryWorkspacePool::CleanUpAndDestroyAllWorkspaces ( )

Definition at line 125 of file G4GeometryWorkspacePool.cc.

126 {
127 }
void G4GeometryWorkspacePool::CreateAndUseWorkspace ( )

Definition at line 91 of file G4GeometryWorkspacePool.cc.

92 {
93  (this->CreateWorkspace())->UseWorkspace();
94 }
G4GeometryWorkspace * CreateWorkspace()

Here is the call graph for this function:

Here is the caller graph for this function:

G4GeometryWorkspace * G4GeometryWorkspacePool::CreateWorkspace ( )

Definition at line 60 of file G4GeometryWorkspacePool.cc.

61 {
62  G4GeometryWorkspace* geometryWrk=0;
63  if( !fMyWorkspace )
64  {
65  geometryWrk= new G4GeometryWorkspace();
66 
67  if( !geometryWrk )
68  {
69  G4Exception("GeometryWorspacePool::CreateWorkspace", "GeomVol003",
70  FatalException, "Failed to create workspace.");
71  }
72  else
73  {
74  fMyWorkspace= geometryWrk;
75  }
76  }
77  else
78  {
79  G4Exception("GeometryWorspacePool::CreateWorkspace", "GeomVol003",
81  "Cannot create workspace twice for the same thread.");
82  geometryWrk= fMyWorkspace;
83  }
84 
85  return geometryWrk;
86 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Here is the call graph for this function:

Here is the caller graph for this function:

G4GeometryWorkspace * G4GeometryWorkspacePool::FindOrCreateWorkspace ( )

Definition at line 99 of file G4GeometryWorkspacePool.cc.

100 {
101  G4GeometryWorkspace* geometryWrk= fMyWorkspace;
102  if( !geometryWrk )
103  {
104  geometryWrk= this->CreateWorkspace();
105  }
106  geometryWrk->UseWorkspace();
107 
108  fMyWorkspace= geometryWrk; // assign it for use by this thread.
109  return geometryWrk;
110 }
G4GeometryWorkspace * CreateWorkspace()

Here is the call graph for this function:

G4GeometryWorkspacePool * G4GeometryWorkspacePool::GetInstance ( )
static

Definition at line 50 of file G4GeometryWorkspacePool.cc.

51 {
52  G4AutoLock l(&singletonM);
53  if ( !thePool ) { thePool= new G4GeometryWorkspacePool(); }
54  return thePool;
55 }

Here is the caller graph for this function:

G4GeometryWorkspace* G4GeometryWorkspacePool::GetWorkspace ( )
inline

Definition at line 68 of file G4GeometryWorkspacePool.hh.

68 { return fMyWorkspace; }

Here is the caller graph for this function:

void G4GeometryWorkspacePool::Recycle ( G4GeometryWorkspace geometryWrk)

Definition at line 114 of file G4GeometryWorkspacePool.cc.

115 {
116  geometryWrk->ReleaseWorkspace();
117  // if( fWarehouse ){
118  // } else {
119  delete geometryWrk;
120  // }
121 }

Here is the call graph for this function:

void G4GeometryWorkspacePool::ReleaseAndDestroyWorkspace ( G4GeometryWorkspace )
protected

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