Geant4
10.03
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
G4RegionStore.hh
Go to the documentation of this file.
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
26
//
27
// $Id: G4RegionStore.hh 89814 2015-04-30 14:49:43Z gcosmo $
28
//
29
// class G4RegionStore
30
//
31
// Class description:
32
//
33
// Container for all regiong, with functionality derived from
34
// std::vector<T>. The class is a `singleton', in that only
35
// one can exist, and access is provided via the static method
36
// G4RegionStore::GetInstance().
37
//
38
// All regions should be registered with G4RegionStore, and removed on their
39
// destruction. The underlying container initially has a capacity of 20.
40
//
41
// If much additional functionality is added, should consider containment
42
// instead of inheritance for std::vector<T>
43
//
44
// Member data:
45
//
46
// static G4RegionStore*
47
// - Pointer to the single G4RegionStore
48
49
// History:
50
// 18.09.02 G.Cosmo Initial version
51
// --------------------------------------------------------------------
52
#ifndef G4REGIONSTORE_HH
53
#define G4REGIONSTORE_HH
54
55
#include <vector>
56
#include "
G4Types.hh
"
57
#include "G4String.hh"
58
#include "
G4VStoreNotifier.hh
"
59
60
class
G4Region
;
61
class
G4VPhysicalVolume
;
62
63
class
G4RegionStore
:
public
std::vector<G4Region*>
64
{
65
public
:
// with description
66
67
static
void
Register
(
G4Region
* pRegion);
68
// Add the region to the collection.
69
static
void
DeRegister
(
G4Region
* pRegion);
70
// Remove the region from the collection.
71
static
G4RegionStore
*
GetInstance
();
72
// Get a ptr to the unique G4RegionStore, creating it if necessary.
73
static
void
SetNotifier
(
G4VStoreNotifier
* pNotifier);
74
// Assign a notifier for allocation/deallocation of regions.
75
static
void
Clean
();
76
// Delete all regions from the store except for the world region.
77
78
G4bool
IsModified
()
const
;
79
// Loops through all regions to verify if a region has been
80
// modified. It returns TRUE if just one region is modified.
81
void
ResetRegionModified
();
82
// Loops through all regions to reset flag for modification
83
// to FALSE. Used by the run manager to notify that the
84
// physics table has been updated.
85
86
void
UpdateMaterialList
(
G4VPhysicalVolume
* currentWorld=0);
87
// Forces recomputation of material lists in all regions
88
// in the store.
89
90
G4Region
*
GetRegion
(
const
G4String
&
name
,
G4bool
verbose=
true
)
const
;
91
// Returns a region through its name specification.
92
93
G4Region
*
FindOrCreateRegion
(
const
G4String
& name);
94
// Returns a region through its name specification, if it exists.
95
// If it does not exist it will allocate one delegating ownership
96
// to the client.
97
98
public
:
// without description
99
100
void
SetWorldVolume
();
101
// Set a world volume pointer to a region that belongs to it.
102
// Scan over all world volumes.
103
// This method should be exclusively used by G4RunManagerKernel.
104
105
protected
:
106
107
G4RegionStore
();
108
// Protected singleton constructor.
109
virtual
~G4RegionStore
();
110
// Destructor: takes care to delete allocated regions.
111
112
private
:
113
114
static
G4RegionStore
*
fgInstance
;
115
static
G4ThreadLocal
G4VStoreNotifier
*
fgNotifier
;
116
static
G4ThreadLocal
G4bool
locked
;
117
};
118
119
#endif
G4RegionStore::GetRegion
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
Definition:
G4RegionStore.cc:216
G4RegionStore::UpdateMaterialList
void UpdateMaterialList(G4VPhysicalVolume *currentWorld=0)
Definition:
G4RegionStore.cc:203
G4Types.hh
G4VPhysicalVolume
Definition:
G4VPhysicalVolume.hh:82
G4RegionStore::fgNotifier
static G4ThreadLocal G4VStoreNotifier * fgNotifier
Definition:
G4RegionStore.hh:115
G4RegionStore::SetNotifier
static void SetNotifier(G4VStoreNotifier *pNotifier)
Definition:
G4RegionStore.cc:122
G4VNotifier
Definition:
G4VNotifier.hh:43
G4InuclParticleNames::name
const char * name(G4int ptype)
Definition:
G4InuclParticleNames.hh:77
G4RegionStore::FindOrCreateRegion
G4Region * FindOrCreateRegion(const G4String &name)
Definition:
G4RegionStore.cc:240
G4ThreadLocal
#define G4ThreadLocal
Definition:
tls.hh:89
G4RegionStore::SetWorldVolume
void SetWorldVolume()
Definition:
G4RegionStore.cc:255
G4RegionStore::DeRegister
static void DeRegister(G4Region *pRegion)
Definition:
G4RegionStore.cc:142
G4RegionStore::GetInstance
static G4RegionStore * GetInstance()
Definition:
G4RegionStore.cc:162
G4RegionStore::fgInstance
static G4RegionStore * fgInstance
Definition:
G4RegionStore.hh:114
G4bool
bool G4bool
Definition:
G4Types.hh:79
G4VStoreNotifier.hh
G4RegionStore::ResetRegionModified
void ResetRegionModified()
Definition:
G4RegionStore.cc:191
G4RegionStore::G4RegionStore
G4RegionStore()
Definition:
G4RegionStore.cc:58
G4RegionStore
Definition:
G4RegionStore.hh:63
G4Region
Definition:
G4Region.hh:99
G4RegionStore::Clean
static void Clean()
Definition:
G4RegionStore.cc:77
G4RegionStore::IsModified
G4bool IsModified() const
Definition:
G4RegionStore.cc:177
G4RegionStore::~G4RegionStore
virtual ~G4RegionStore()
Definition:
G4RegionStore.cc:68
G4RegionStore::locked
static G4ThreadLocal G4bool locked
Definition:
G4RegionStore.hh:116
G4RegionStore::Register
static void Register(G4Region *pRegion)
Definition:
G4RegionStore.cc:132
G4String
Definition:
G4String.hh:45
geant4.10.03
source
geometry
management
include
G4RegionStore.hh
Generated on Thu Feb 14 2002 02:28:11 for Geant4 by
1.8.8