Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file RunInitObserver.cc 26 /// \file RunInitObserver.cc 27 /// \brief Implementation of the RunInitObserv 27 /// \brief Implementation of the RunInitObserver class 28 28 29 #include "RunInitObserver.hh" 29 #include "RunInitObserver.hh" 30 30 31 G4ThreadLocal RunInitManager* RunInitManager:: 31 G4ThreadLocal RunInitManager* RunInitManager::fgInstance(0); 32 32 33 //....oooOO0OOooo........oooOO0OOooo........oo 33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 34 34 35 RunInitManager::RunInitManager() 35 RunInitManager::RunInitManager() 36 { 36 { 37 fgInstance = this; << 37 fgInstance = this; 38 } 38 } 39 39 40 //....oooOO0OOooo........oooOO0OOooo........oo 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 41 41 42 RunInitManager::~RunInitManager() {} << 42 RunInitManager::~RunInitManager() >> 43 { >> 44 } 43 45 44 //....oooOO0OOooo........oooOO0OOooo........oo 46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 45 47 46 RunInitObserver::RunInitObserver() 48 RunInitObserver::RunInitObserver() 47 { 49 { 48 RunInitManager::Instance()->Insert(this); << 50 RunInitManager::Instance()->Insert(this); 49 } 51 } 50 52 51 //....oooOO0OOooo........oooOO0OOooo........oo 53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 52 54 53 RunInitObserver::~RunInitObserver() {} << 55 RunInitObserver::~RunInitObserver() >> 56 { >> 57 } 54 58 55 //....oooOO0OOooo........oooOO0OOooo........oo 59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 56 60 57 RunInitManager* RunInitManager::Instance() 61 RunInitManager* RunInitManager::Instance() 58 { 62 { 59 if (fgInstance == 0) new RunInitManager(); << 63 if(fgInstance == 0) new RunInitManager(); 60 return fgInstance; << 64 return fgInstance; 61 } 65 } 62 66 63 //....oooOO0OOooo........oooOO0OOooo........oo 67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 64 68 65 void RunInitManager::Initialize() 69 void RunInitManager::Initialize() 66 { 70 { 67 std::vector<RunInitObserver*>::iterator it = << 71 std::vector<RunInitObserver*>::iterator it = fObservers.begin(); 68 std::vector<RunInitObserver*>::iterator end << 72 std::vector<RunInitObserver*>::iterator end = fObservers.end(); 69 73 70 for (; it != end; it++) << 74 for(; it != end ; it++) 71 (*it)->Initialize(); << 75 (*it)->Initialize(); 72 } 76 } 73 77 74 //....oooOO0OOooo........oooOO0OOooo........oo 78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 75 79 76 void RunInitManager::Insert(RunInitObserver* o 80 void RunInitManager::Insert(RunInitObserver* observer) 77 { 81 { 78 fObservers.push_back(observer); << 82 fObservers.push_back(observer); 79 } 83 } >> 84 80 85