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

#include <G4SolidsWorkspacePool.hh>

Public Member Functions

G4SolidsWorkspaceCreateWorkspace ()
 
void CreateAndUseWorkspace ()
 
G4SolidsWorkspaceFindOrCreateWorkspace ()
 
G4SolidsWorkspaceGetWorkspace ()
 
void Recycle (G4SolidsWorkspace *)
 
void CleanUpAndDestroyAllWorkspaces ()
 

Static Public Member Functions

static G4SolidsWorkspacePoolGetInstance ()
 

Protected Member Functions

void ReleaseAndDestroyWorkspace (G4SolidsWorkspace *)
 

Detailed Description

Definition at line 38 of file G4SolidsWorkspacePool.hh.

Member Function Documentation

void G4SolidsWorkspacePool::CleanUpAndDestroyAllWorkspaces ( )

Definition at line 118 of file G4SolidsWorkspacePool.cc.

119 {
120 }
void G4SolidsWorkspacePool::CreateAndUseWorkspace ( )

Definition at line 74 of file G4SolidsWorkspacePool.cc.

75 {
76  (this->CreateWorkspace())->UseWorkspace();
77 }
G4SolidsWorkspace * CreateWorkspace()

Here is the call graph for this function:

Here is the caller graph for this function:

G4SolidsWorkspace * G4SolidsWorkspacePool::CreateWorkspace ( )

Definition at line 50 of file G4SolidsWorkspacePool.cc.

51 {
52  G4SolidsWorkspace* geometryWrk=0;
53  if( !fMyWorkspace ){
54  geometryWrk= new G4SolidsWorkspace();
55 
56  if( !geometryWrk ) {
57  G4Exception("GeometryWorspacePool::CreateWorkspace", "Geom-003",
58  FatalException, "Failed to create workspace.");
59  }else{
60  // geometryWrk->UseWorkspace(); // Do not assign it already.
61  fMyWorkspace= geometryWrk;
62  }
63  }else{
64  G4Exception("GeometryWorspacePool::CreateWorkspace", "Geom-003",
66  "Cannot create workspace twice for the same thread.");
67  geometryWrk= fMyWorkspace;
68  }
69 
70  return geometryWrk;
71 }
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:

G4SolidsWorkspace * G4SolidsWorkspacePool::FindOrCreateWorkspace ( )

Definition at line 81 of file G4SolidsWorkspacePool.cc.

82 {
83  G4SolidsWorkspace* geometryWrk= fMyWorkspace;
84  if( !geometryWrk ){
85  geometryWrk= this->CreateWorkspace();
86  }
87  geometryWrk->UseWorkspace();
88 
89  fMyWorkspace= geometryWrk; // assign it for use by this thread.
90  return geometryWrk;
91 }
G4SolidsWorkspace * CreateWorkspace()

Here is the call graph for this function:

G4SolidsWorkspacePool * G4SolidsWorkspacePool::GetInstance ( )
static

Definition at line 42 of file G4SolidsWorkspacePool.cc.

43 {
44  G4AutoLock l(&singletonMutexSWP);
45  if( !thePool ) thePool= new G4SolidsWorkspacePool();
46  return thePool;
47 }

Here is the caller graph for this function:

G4SolidsWorkspace* G4SolidsWorkspacePool::GetWorkspace ( )
inline

Definition at line 53 of file G4SolidsWorkspacePool.hh.

53 { return fMyWorkspace; }

Here is the caller graph for this function:

void G4SolidsWorkspacePool::Recycle ( G4SolidsWorkspace geometryWrk)

Definition at line 107 of file G4SolidsWorkspacePool.cc.

108 {
109  geometryWrk->ReleaseWorkspace();
110 // if( fWarehouse ){
111 // } else {
112  delete geometryWrk;
113 // }
114 }

Here is the call graph for this function:

void G4SolidsWorkspacePool::ReleaseAndDestroyWorkspace ( G4SolidsWorkspace )
protected

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