Geant4  10.02.p03
G4SolidsWorkspacePool Class Reference

#include <G4SolidsWorkspacePool.hh>

Collaboration diagram for G4SolidsWorkspacePool:

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 *)
 

Private Member Functions

 G4SolidsWorkspacePool ()
 
 ~G4SolidsWorkspacePool ()
 

Static Private Attributes

static G4SolidsWorkspacePoolthePool =0
 
static G4ThreadLocal G4SolidsWorkspacefMyWorkspace =0
 

Detailed Description

Definition at line 38 of file G4SolidsWorkspacePool.hh.

Constructor & Destructor Documentation

◆ G4SolidsWorkspacePool()

G4SolidsWorkspacePool::G4SolidsWorkspacePool ( )
private

Definition at line 123 of file G4SolidsWorkspacePool.cc.

124 {
125 // fWarehouse=0;
126 }
Here is the caller graph for this function:

◆ ~G4SolidsWorkspacePool()

G4SolidsWorkspacePool::~G4SolidsWorkspacePool ( )
private

Definition at line 128 of file G4SolidsWorkspacePool.cc.

129 {
130 }
Here is the caller graph for this function:

Member Function Documentation

◆ CleanUpAndDestroyAllWorkspaces()

void G4SolidsWorkspacePool::CleanUpAndDestroyAllWorkspaces ( )

Definition at line 118 of file G4SolidsWorkspacePool.cc.

119 {
120 }
Here is the caller graph for this function:

◆ CreateAndUseWorkspace()

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:

◆ CreateWorkspace()

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 }
static G4ThreadLocal G4SolidsWorkspace * fMyWorkspace
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:

◆ FindOrCreateWorkspace()

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 }
static G4ThreadLocal G4SolidsWorkspace * fMyWorkspace
G4SolidsWorkspace * CreateWorkspace()
Here is the call graph for this function:

◆ GetInstance()

G4SolidsWorkspacePool * G4SolidsWorkspacePool::GetInstance ( void  )
static

Definition at line 42 of file G4SolidsWorkspacePool.cc.

43 {
44  G4AutoLock l(&singletonMutexSWP);
46  return thePool;
47 }
static G4SolidsWorkspacePool * thePool
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetWorkspace()

G4SolidsWorkspace* G4SolidsWorkspacePool::GetWorkspace ( )
inline

Definition at line 53 of file G4SolidsWorkspacePool.hh.

53 { return fMyWorkspace; }
static G4ThreadLocal G4SolidsWorkspace * fMyWorkspace
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Recycle()

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:
Here is the caller graph for this function:

◆ ReleaseAndDestroyWorkspace()

void G4SolidsWorkspacePool::ReleaseAndDestroyWorkspace ( G4SolidsWorkspace )
protected
Here is the caller graph for this function:

Member Data Documentation

◆ fMyWorkspace

G4ThreadLocal G4SolidsWorkspace * G4SolidsWorkspacePool::fMyWorkspace =0
staticprivate

Definition at line 76 of file G4SolidsWorkspacePool.hh.

◆ thePool

G4SolidsWorkspacePool * G4SolidsWorkspacePool::thePool =0
staticprivate

Definition at line 74 of file G4SolidsWorkspacePool.hh.


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