Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4StateManager.hh
이 파일의 문서화 페이지로 가기
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: G4StateManager.hh 110286 2018-05-18 09:40:01Z gcosmo $
28 //
29 //
30 // ------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 //
34 // ---------------- G4StateManager ----------------
35 //
36 // Authors: G.Cosmo, M.Asai - November 1996
37 //
38 // -------------------------------------------------------------
39 //
40 // Class Description:
41 //
42 // Class responsible for handling and updating the running state
43 // of the Geant4 application during its different phases.
44 // The class is a singleton, it can be accessed via the public
45 // method G4StateManager::GetStateManager().
46 //
47 // States of Geant4 are defined in G4ApplicationState.
48 
49 // -------------------------------------------------------------
50 
51 #ifndef G4StateManager_h
52 #define G4StateManager_h 1
53 
54 #include <vector>
55 #include "G4Types.hh"
56 #include "G4String.hh"
57 #include "G4ApplicationState.hh"
58 #include "G4VStateDependent.hh"
59 #include "G4VExceptionHandler.hh"
60 
62 {
63 
64 public: // with description
65 
67  // The G4StateManager class is a singleton class and the pointer
68  // to the only one existing object can be obtained by this static
69  // method.
70 
71 protected:
72 
74 
75 public:
76 
78 
79 public: // with description
80 
82  // Returns the current state
84  // Returns the previous state
85  G4bool SetNewState(G4ApplicationState requestedState);
86  // Set Geant4 to a new state.
87  // In case the request is irregal, false will be returned
88  // and the state of Geant4 will not be changed.
89  G4bool SetNewState(G4ApplicationState requestedState, const char* msg);
90  // Set Geant4 to a new state.
91  // In case the request is irregal, false will be returned
92  // and the state of Geant4 will not be changed.
93  // "msg" is information associating to this state change
94  G4bool RegisterDependent(G4VStateDependent* aDependent,G4bool bottom=false);
95  // Register a concrete class of G4VStateDependent.
96  // Registered concrete classes will be notified via
97  // G4VStateDependent::Notify() method when the state of Geant4 changes.
98  // False will be returned if registration fails.
100  // Remove the registration.
101  // False will be returned if aDependent has not been registered.
103  // Remove the registration.
104  // Removed pointer is returned.
106  // Utility method which returns a string of the state name.
107 
108 public:
109 
110  inline void SetSuppressAbortion(G4int i);
111  inline G4int GetSuppressAbortion() const;
112  inline const char* GetMessage() const;
113  inline void SetExceptionHandler(G4VExceptionHandler* eh);
115  static void SetVerboseLevel(G4int val);
116 
117  //void Pause();
118  //void Pause(const char* msg);
119  //void Pause(G4String msg);
124 
125 private:
126 
128  G4StateManager& operator=(const G4StateManager &right);
129  G4int operator==(const G4StateManager &right) const;
130  G4int operator!=(const G4StateManager &right) const;
131 
132 private:
133 
137  std::vector<G4VStateDependent*> theDependentsList;
140  const char* msgptr;
143 };
144 
145 #include "G4StateManager.icc"
146 
147 #endif
static void SetVerboseLevel(G4int val)
G4bool SetNewState(G4ApplicationState requestedState)
G4VExceptionHandler * GetExceptionHandler() const
const char * msgptr
G4ApplicationState thePreviousState
static G4int verboseLevel
G4int operator!=(const G4StateManager &right) const
static G4ThreadLocal G4StateManager * theStateManager
#define G4ThreadLocal
Definition: tls.hh:69
bool G4bool
Definition: G4Types.hh:79
G4VStateDependent * theBottomDependent
const char * GetMessage() const
G4bool RegisterDependent(G4VStateDependent *aDependent, G4bool bottom=false)
void SetSuppressAbortion(G4int i)
G4String GetStateString(G4ApplicationState aState) const
G4ApplicationState theCurrentState
G4int operator==(const G4StateManager &right) const
int G4int
Definition: G4Types.hh:78
std::vector< G4VStateDependent * > theDependentsList
G4VExceptionHandler * exceptionHandler
G4ApplicationState GetCurrentState() const
G4ApplicationState GetPreviousState() const
G4StateManager & operator=(const G4StateManager &right)
G4int GetSuppressAbortion() const
G4VStateDependent * RemoveDependent(const G4VStateDependent *aDependent)
G4ApplicationState
G4bool DeregisterDependent(G4VStateDependent *aDependent)
void SetExceptionHandler(G4VExceptionHandler *eh)
static G4StateManager * GetStateManager()