37G4int G4StateManager::verboseLevel = 0;
51 while(theDependentsList.size() > 0)
53 state = theDependentsList.back();
54 theDependentsList.pop_back();
55 for(
auto i = theDependentsList.cbegin(); i != theDependentsList.cend();)
59 i = theDependentsList.erase(i);
68 theStateManager =
nullptr;
69#ifdef G4MULTITHREADED_DEACTIVATE
77 if(theStateManager ==
nullptr)
81 return theStateManager;
91 theDependentsList.push_back(aDependent);
95 if(theBottomDependent)
97 theDependentsList.push_back(theBottomDependent);
99 theBottomDependent = aDependent;
108 for(
auto i = theDependentsList.cbegin(); i != theDependentsList.cend();)
110 if(**i == *aDependent)
113 i = theDependentsList.erase(i);
120 return (tmp !=
nullptr);
126 return theCurrentState;
132 return thePreviousState;
147 if(suppressAbortion == 2)
160 thePreviousState = theCurrentState;
162 while((ack) && (i < theDependentsList.size()))
164 ack = theDependentsList[i]->Notify(requestedState);
167 if(theBottomDependent)
169 ack = theBottomDependent->
Notify(requestedState);
174 thePreviousState = savedState;
178 theCurrentState = requestedState;
181 G4cout <<
"#### G4StateManager::SetNewState from "
195 for(
auto i = theDependentsList.cbegin(); i != theDependentsList.cend();)
197 if(**i == *aDependent)
200 i = theDependentsList.erase(i);
217 stateName =
"PreInit";
226 stateName =
"GeomClosed";
229 stateName =
"EventProc";
238 stateName =
"Unknown";
G4GLOB_DLL std::ostream G4cout
void G4iosInitialization()
const G4ApplicationState & GetCurrentState() const
G4VStateDependent * RemoveDependent(const G4VStateDependent *aDependent)
G4StateManager(const G4StateManager &)=delete
G4String GetStateString(const G4ApplicationState &aState) const
G4bool RegisterDependent(G4VStateDependent *aDependent, G4bool bottom=false)
static G4StateManager * GetStateManager()
static void SetVerboseLevel(G4int val)
G4bool SetNewState(const G4ApplicationState &requestedState)
G4bool DeregisterDependent(G4VStateDependent *aDependent)
const G4ApplicationState & GetPreviousState() const
virtual G4bool Notify(G4ApplicationState requestedState)=0