//#include CORBA_SERVER_HEADER(SUPERV)
#include <SALOME_LifeCycleCORBA.hxx>
+class Graph_Impl ;
+
namespace GraphBase {
class Graph ;
}
SuspendedErroredState,
ResumedSuccessedState ,
ResumedErroredState ,
- KilledSuccessedState ,
+ KilledSuccessedState ,
KilledErroredState ,
- StoppedSuccessedState ,
+ StoppedSuccessedState ,
StoppedErroredState ,
SuccessedState ,
ErroredState ,
StoppedState ,
SuspendedSuccessedToReStartState ,
SuspendedErroredToReStartState ,
- ReRunnedState ,
ReStartedState ,
+ LoadingState,
NumberOfAutomatonStates } ;
- enum NodeEvent { UndefinedEvent , NewThreadEvent ,
- SuspendEvent , ToResumeEvent , ResumeEvent ,
- KillEvent , StopEvent ,
- ExecuteEvent , SuccessEvent , ErrorEvent ,
- ToReStartEvent , ReStartEvent , ReStartAndSuspendEvent ,
- EndExecuteEvent ,
- NoDataReadyEvent , SomeDataReadyEvent ,
- NotAllDataReadyEvent , AllDataReadyEvent ,
- ReadyEvent , SuspendedReadyEvent ,ResumedReadyEvent ,
- KilledReadyEvent , StoppedReadyEvent ,
- ExecutingEvent , SuspendedExecutingEvent ,
- ResumedExecutingEvent , KilledExecutingEvent ,
+ enum NodeEvent { UndefinedEvent ,
+ NewThreadEvent ,
+ SuspendEvent ,
+ ToResumeEvent ,
+ ResumeEvent ,
+ KillEvent ,
+ StopEvent ,
+ ExecuteEvent ,
+ SuccessEvent ,
+ ErrorEvent ,
+ ToReStartEvent ,
+ ReStartEvent ,
+ ReStartAndSuspendEvent ,
+ EndExecuteEvent ,
+ NoDataReadyEvent ,
+ SomeDataReadyEvent ,
+ NotAllDataReadyEvent ,
+ AllDataReadyEvent ,
+ ReadyEvent ,
+ SuspendedReadyEvent ,
+ ResumedReadyEvent ,
+ KilledReadyEvent ,
+ StoppedReadyEvent ,
+ ExecutingEvent ,
+ SuspendedExecutingEvent ,
+ ResumedExecutingEvent ,
+ KilledExecutingEvent ,
StoppedExecutingEvent ,
- SuccessedExecutingEvent , ErroredExecutingEvent ,
- SuspendedSuccessedEvent , SuspendedErroredEvent ,
- ResumedSuccessedEvent , ResumedErroredEvent ,
- KilledEvent , StoppedEvent ,
- ReStartedEvent , ReStartedAndSuspendEvent ,
- NumberOfEvents } ;
+ SuccessedExecutingEvent ,
+ ErroredExecutingEvent ,
+ SuspendedSuccessedEvent ,
+ SuspendedErroredEvent ,
+ ResumedSuccessedEvent ,
+ ResumedErroredEvent ,
+ KilledEvent ,
+ StoppedEvent ,
+ ReStartedEvent ,
+ ReStartedAndSuspendEvent ,
+ NumberOfEvents } ;
enum StateEventAction { ErrorAction ,
VoidAction ,
executeAction , // +- pthread_create
ExecuteAction , // +- pthread_create
- DataWaiting_SomeDataReadyAction ,
- DataUndef_NotAllDataReadyAction ,
- DataUndef_AllDataReadyAction ,
+ DataWaiting_SomeDataReadyAction ,
+ DataUndef_NotAllDataReadyAction ,
+ DataUndef_AllDataReadyAction ,
DataReady_SuspendAction ,
SuspendedReady_ResumeAction ,
DataReady_KillAction ,
DataReady_StopAction ,
- DataReady_ExecuteAction ,
+ DataReady_ExecuteAction ,
Executing_SuspendAction ,
SuspendedExecuting_ResumeAction ,
Executing_KillAction ,
Executing_StopAction ,
- Executing_SuccessAction ,
- Executing_ErrorAction ,
+ Executing_SuccessAction ,
+// Executing_ErrorAction ,
+ Errored_ExecutingAction ,
Successed_SuccessAction ,
Errored_ErrorAction ,
Successed_SuspendAction ,
Errored_KillAction ,
Successed_StopAction ,
Errored_StopAction ,
- SuspendedSuccessed_ReStartAction ,
- SuspendedErrored_ReStartAction ,
- SuspendedSuccessed_ReStartAndSuspendAction ,
- SuspendedErrored_ReStartAndSuspendAction ,
+ SuspendedSuccessed_ReStartAction ,
+ SuspendedErrored_ReStartAction ,
+ SuspendedSuccessed_ReStartAndSuspendAction ,
+ SuspendedErrored_ReStartAndSuspendAction ,
NumberOfActions } ;
class FiniteStateMachine {
[ GraphExecutor::NumberOfEvents ] ;
pthread_mutex_t _MutexPythonWait ;
+ bool _MutexPythonLocked ;
+// Map between FuncName and corresponding Python Object Function
map< string , PyObject * > _MapOfPyFunctions ;
bool _PyInitModule ;
int _ExecNumber ;
pthread_cond_t _JoinWait ;
list< pthread_t > _ThreadList ;
+ Graph_Impl * _GraphImpl ;
+
public :
FiniteStateMachine() ;
int ExecNumber() ;
void Executed() ;
+ void PyInitModule(bool) ;
bool PyInitModule() ;
void PyLock() ;
void PyUnLock() ;
+ void PyLockReset() ;
bool PyFunction( const char * aPyFuncName , PyObject * aPyFunction ) ;
PyObject * PyFunction( const char * aPyFuncName ) ;
+ bool ErasePyFunction( const char * aPyFuncName ) ;
string DbgFileNumber() {
const GraphExecutor::StateEventAction NextAction( const GraphExecutor::AutomatonState & aState ,
const GraphExecutor::NodeEvent & anEvent ) const {
return _ActionTable[ aState ][ anEvent ] ; } ;
+
+ void GraphImpl( Graph_Impl * aGraphImpl ) {// For GraphMNode ...
+ _GraphImpl = aGraphImpl ; } ;
+ Graph_Impl * GraphImpl() {
+ return _GraphImpl ; } ;
};
};