#include <G4AccumulableManager.hh>
Definition at line 46 of file G4AccumulableManager.hh.
◆ ~G4AccumulableManager()
G4AccumulableManager::~G4AccumulableManager |
( |
| ) |
|
|
virtual |
Definition at line 55 of file G4AccumulableManager.cc.
56{
57
58 for ( auto it : fAccumulablesToDelete ) {
59 delete it;
60 }
61}
◆ Begin()
std::vector< G4VAccumulable * >::iterator G4AccumulableManager::Begin |
( |
| ) |
|
◆ BeginConst()
std::vector< G4VAccumulable * >::const_iterator G4AccumulableManager::BeginConst |
( |
| ) |
const |
◆ CreateAccumulable() [1/2]
◆ CreateAccumulable() [2/2]
template<typename T >
G4Accumulable< T > * G4AccumulableManager::CreateAccumulable |
( |
T |
value, |
|
|
G4MergeMode |
mergeMode = G4MergeMode::kAddition |
|
) |
| |
◆ End()
std::vector< G4VAccumulable * >::iterator G4AccumulableManager::End |
( |
| ) |
|
◆ EndConst()
std::vector< G4VAccumulable * >::const_iterator G4AccumulableManager::EndConst |
( |
| ) |
const |
◆ GetAccumulable() [1/4]
◆ GetAccumulable() [2/4]
Definition at line 117 of file G4AccumulableManager.cc.
118{
119
120 auto it = fMap.find(name);
121 if ( it == fMap.end() ) {
122 if ( warn) {
124 description <<
"Accumulable " <<
name <<
" does not exist.";
125 G4Exception(
"G4AccumulableManager::GetAccumulable",
127 }
128 return nullptr;
129 }
130
131 return it->second;
132}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
const char * name(G4int ptype)
◆ GetAccumulable() [3/4]
◆ GetAccumulable() [4/4]
Definition at line 136 of file G4AccumulableManager.cc.
137{
138
139 if ( id < 0 || id >=
G4int(fVector.size()) ) {
140 if ( warn) {
142 description << "Accumulable " << id << " does not exist.";
143 G4Exception(
"G4AccumulableManager::GetAccumulable",
145 }
146 return nullptr;
147 }
148
149 return fVector[id];
150}
◆ GetNofAccumulables()
G4int G4AccumulableManager::GetNofAccumulables |
( |
| ) |
const |
◆ Instance()
◆ Merge()
void G4AccumulableManager::Merge |
( |
| ) |
|
Definition at line 153 of file G4AccumulableManager.cc.
154{
155
156
158
159
160 if (fgMasterInstance == nullptr) {
162 description
163 <<
"No master G4AccumulableManager instance exists." <<
G4endl
164 << "Accumulables will not be merged.";
167 return;
168 }
169
170
171
172
174
175
176 auto it = fVector.begin();
177 for ( auto itMaster : fgMasterInstance->fVector ) {
178
179
180
181 itMaster->Merge(*(*(it++)));
182 }
183 lock.unlock();
184}
◆ RegisterAccumulable() [1/2]
◆ RegisterAccumulable() [2/2]
Definition at line 97 of file G4AccumulableManager.cc.
98{
100
101
102 if ( ! CheckName(name, "RegisterAccumulable") ) return false;
103
104
105 if (
name.length() == 0u) {
106 name = GenerateName();
108 }
109
110 fMap[
name] = accumulable;
111 fVector.push_back(accumulable);
112 return true;
113}
◆ Reset()
void G4AccumulableManager::Reset |
( |
| ) |
|
◆ G4ThreadLocalSingleton< G4AccumulableManager >
The documentation for this class was generated from the following files: