47 theBottomDependent(0),
52 #ifdef G4MULTITHREADED
61 while (theDependentsList.size()>0)
63 state = theDependentsList.back();
64 theDependentsList.pop_back();
65 for (std::vector<G4VStateDependent*>::iterator
66 i=theDependentsList.begin(); i!=theDependentsList.end();)
70 i = theDependentsList.erase(i);
77 if ( state ) {
delete state; }
79 #ifdef G4MULTITHREADED_DEACTIVATE
90 : theCurrentState(right.theCurrentState),
91 thePreviousState(right.thePreviousState),
92 theDependentsList(right.theDependentsList),
93 theBottomDependent(right.theBottomDependent),
94 suppressAbortion(right.suppressAbortion),
96 exceptionHandler(right.exceptionHandler)
103 if (&right ==
this) {
return *
this; }
105 theCurrentState = right.theCurrentState;
106 thePreviousState = right.thePreviousState;
107 theDependentsList = right.theDependentsList;
108 theBottomDependent = right.theBottomDependent;
109 suppressAbortion = right.suppressAbortion;
110 msgptr = right.msgptr;
111 exceptionHandler = right.exceptionHandler;
119 return (
this == &right);
125 return (
this != &right);
133 if (!theStateManager)
137 return theStateManager;
146 theDependentsList.push_back(aDependent);
150 if(theBottomDependent)
152 theDependentsList.push_back(theBottomDependent);
154 theBottomDependent = aDependent;
163 for (std::vector<G4VStateDependent*>::iterator i=theDependentsList.begin();
164 i!=theDependentsList.end();)
166 if (**i==*aDependent)
169 i = theDependentsList.erase(i);
182 return theCurrentState;
188 return thePreviousState;
200 if(suppressAbortion==2) {
return false; }
207 thePreviousState = theCurrentState;
208 while ((ack) && (i<theDependentsList.size()))
210 ack = theDependentsList[i]->Notify(requestedState);
213 if(theBottomDependent)
215 ack = theBottomDependent->
Notify(requestedState);
219 { thePreviousState = savedState; }
221 { theCurrentState = requestedState; }
230 for (std::vector<G4VStateDependent*>::iterator i=theDependentsList.begin();
231 i!=theDependentsList.end();)
233 if (**i==*aDependent)
236 i = theDependentsList.erase(i);
253 stateName =
"PreInit";
break;
255 stateName =
"Init";
break;
257 stateName =
"Idle";
break;
259 stateName =
"GeomClosed";
break;
261 stateName =
"EventProc";
break;
263 stateName =
"Quit";
break;
265 stateName =
"Abort";
break;
267 stateName =
"Unknown";
break;
G4ApplicationState GetPreviousState() const
G4bool RegisterDependent(G4VStateDependent *aDependent, G4bool bottom=false)
static G4StateManager * GetStateManager()
virtual G4bool Notify(G4ApplicationState requestedState)=0
G4bool SetNewState(G4ApplicationState requestedState)
G4ApplicationState GetCurrentState() const
void G4iosInitialization()
G4VStateDependent * RemoveDependent(const G4VStateDependent *aDependent)
G4String GetStateString(G4ApplicationState aState) const
G4bool DeregisterDependent(G4VStateDependent *aDependent)