46 theBottomDependent(0),
57 while (theDependentsList.size()>0)
59 state = theDependentsList.back();
60 theDependentsList.pop_back();
61 for (std::vector<G4VStateDependent*>::iterator
62 i=theDependentsList.begin(); i!=theDependentsList.end();)
66 i = theDependentsList.erase(i);
73 if ( state ) {
delete state; }
83 : theCurrentState(right.theCurrentState),
84 thePreviousState(right.thePreviousState),
85 theDependentsList(right.theDependentsList),
86 theBottomDependent(right.theBottomDependent),
87 suppressAbortion(right.suppressAbortion),
89 exceptionHandler(right.exceptionHandler)
96 if (&right ==
this) {
return *
this; }
98 theCurrentState = right.theCurrentState;
99 thePreviousState = right.thePreviousState;
100 theDependentsList = right.theDependentsList;
101 theBottomDependent = right.theBottomDependent;
102 suppressAbortion = right.suppressAbortion;
103 msgptr = right.msgptr;
104 exceptionHandler = right.exceptionHandler;
112 return (
this == &right);
118 return (
this != &right);
126 if (!theStateManager)
130 return theStateManager;
139 theDependentsList.push_back(aDependent);
143 if(theBottomDependent)
145 theDependentsList.push_back(theBottomDependent);
147 theBottomDependent = aDependent;
156 for (std::vector<G4VStateDependent*>::iterator i=theDependentsList.begin();
157 i!=theDependentsList.end();)
159 if (**i==*aDependent)
162 i = theDependentsList.erase(i);
175 return theCurrentState;
181 return thePreviousState;
193 if(suppressAbortion==2) {
return false; }
200 thePreviousState = theCurrentState;
201 while ((ack) && (i<theDependentsList.size()))
203 ack = theDependentsList[i]->Notify(requestedState);
206 if(theBottomDependent)
208 ack = theBottomDependent->
Notify(requestedState);
212 { thePreviousState = savedState; }
214 { theCurrentState = requestedState; }
223 for (std::vector<G4VStateDependent*>::iterator i=theDependentsList.begin();
224 i!=theDependentsList.end();)
226 if (**i==*aDependent)
229 i = theDependentsList.erase(i);
246 stateName =
"PreInit";
break;
248 stateName =
"Init";
break;
250 stateName =
"Idle";
break;
252 stateName =
"GeomClosed";
break;
254 stateName =
"EventProc";
break;
256 stateName =
"Quit";
break;
258 stateName =
"Abort";
break;
260 stateName =
"Unknown";
break;
G4VStateDependent * RemoveDependent(const G4VStateDependent *aDependent)
G4ApplicationState GetCurrentState() const
G4bool RegisterDependent(G4VStateDependent *aDependent, G4bool bottom=false)
static G4StateManager * GetStateManager()
G4ApplicationState GetPreviousState() const
G4bool SetNewState(G4ApplicationState requestedState)
G4String GetStateString(G4ApplicationState aState) const
G4bool DeregisterDependent(G4VStateDependent *aDependent)
virtual G4bool Notify(G4ApplicationState requestedState)=0