Salome HOME
InitLoop and DoLoop parameters names
[modules/superv.git] / src / GraphExecutor / DataFlowExecutor_InNode.hxx
index 9eb952cbe825539ed856cdc2d7c1b5b6e2b0a81c..1b25ab5ad79f3f477d26b661fabccded3d741930 100644 (file)
@@ -33,6 +33,9 @@
 
 #include <Python.h>
 
+#include "SALOME_Container_i.hxx"
+
+#include "DataFlowBase_Graph.hxx"
 #include "DataFlowBase_FactoryNode.hxx"
 #include "DataFlowBase_GOTONode.hxx"
 #include "DataFlowBase_LoopNode.hxx"
@@ -42,7 +45,7 @@
 
 #include "DataFlowExecutor_FiniteStateMachine.hxx"
 
-#define MAXSTACKTHREADSIZE 8191
+#define MAXSTACKTHREADSIZE 127
 
 void * run_function(void *p);
 
@@ -72,19 +75,21 @@ namespace GraphExecutor {
       GraphBase::EndOfLoopNode       * _EndOfLoopNode ;
       GraphBase::SwitchNode          * _SwitchNode ;
       GraphBase::EndOfSwitchNode     * _EndOfSwitchNode ;
+      GraphBase::Graph               * _GraphMacroNode ;
 
       PyObject                       * _MyPyRunMethod ;
 
       bool                             _createNewThread ;
       bool                             _createNewThreadIf ;
       int                              _RewindStack ;
-      SUPERV::AutomatonState           _OldState ;
-      SUPERV::AutomatonState           _currentState ;
+      GraphExecutor::AutomatonState    _OldState ;
+      GraphExecutor::AutomatonState    _currentState ;
       GraphExecutor::NodeEvent         _CurrentEvent ;
       SUPERV::ControlState             _ControlState ;
-      SUPERV::AutomatonState           _NextState ;
+      GraphExecutor::AutomatonState    _NextState ;
       GraphExecutor::StateEventAction  _NextAction ;
       bool                             _PyFuncRunned ;
+      bool                             _Loading ;
     
       pthread_mutex_t                  _MutexDataWait ;
       bool                             _DataWait ;
@@ -122,6 +127,7 @@ namespace GraphExecutor {
       GraphExecutor::OutNode          * _OutNode ;
 
       char                            * _DataFromNode ;
+      bool                              _InitLoop ;
 
     public:
 
@@ -168,8 +174,12 @@ namespace GraphExecutor {
                  return _ComputingNode->IsOneOfInLineNodes() ; } ;
       const bool IsOneOfGOTONodes() const {
                  return _ComputingNode->IsOneOfGOTONodes() ; } ;
+      const bool IsMacroNode() const {
+                 return _ComputingNode->IsMacroNode() ; } ;
       const bool IsDataFlowNode() const {
                  return _ComputingNode->IsDataFlowNode() ; } ;
+      const bool IsDataStreamNode() const {
+                 return _ComputingNode->IsDataStreamNode() ; } ;
       const bool IsLoopNode() const {
                  return _ComputingNode->IsLoopNode() ; } ;
       const bool IsEndLoopNode() const {
@@ -207,6 +217,16 @@ namespace GraphExecutor {
                               } ;
       GraphBase::LoopNode * LoopNode() {
                             return _LoopNode ; } ;
+      GraphBase::Graph * GraphMacroNode() {
+                         return _GraphMacroNode ; } ;
+
+      SUPERV::CNode_var ObjRef() const { return _ComputingNode->ObjRef() ; } ;
+      void SetObjRef( SUPERV::CNode_var aNode ) {
+                     _ComputingNode->SetObjRef( aNode ) ; } ;
+
+      CNode_Impl * ObjImpl() const { return _ComputingNode->ObjImpl() ; } ;
+      void SetObjImpl( CNode_Impl * aGraph ) {
+                       _ComputingNode->SetObjImpl( aGraph ) ; } ;
 
       Engines::Component_var Component() const ;
       Engines::Container_var Container() const ;
@@ -299,10 +319,14 @@ namespace GraphExecutor {
       bool PyFuncRunned() {
            return _PyFuncRunned ; } ;
 
+      void OutNode( GraphExecutor::OutNode * theOutNode ) {
+           _OutNode = theOutNode ; } ;
+
       bool InitPython() ;
       PyObject * InitPyDynInvoke( char * PyFuncName ,
                                   const SUPERV::ListOfStrings * aPythonFunction ,
                                   bool & Err ) ;
+      void RemovePyDynInvoke( char * PyFuncName ) ;
 
       void LockDataWait() ;
       void UnLockDataWait() ;
@@ -316,7 +340,6 @@ namespace GraphExecutor {
       bool Suspend() ;
       bool SuspendDone() ;
       bool Resume() ;
-      bool ReStart( const char * AtNodeName , const bool AndSuspend ) ;
       bool Stop() ;
 
       void CreateNewThread( bool k_create ) { _createNewThread = k_create ; } ;
@@ -328,9 +351,9 @@ namespace GraphExecutor {
       void RewindStack( int aRewindStack ) { _RewindStack = aRewindStack ; } ;
       int RewindStack() const { return _RewindStack ; } ;
 
-      SUPERV::AutomatonState State() const {
+      GraphExecutor::AutomatonState State() const {
              return _currentState; };
-      void State(SUPERV::AutomatonState aState ) {
+      void State(GraphExecutor::AutomatonState aState ) {
 //           cdebug << "GraphExecutor::InNode::State( "
 //                  << Automaton()->StateName( _currentState ) << " --> "
 //                  << Automaton()->StateName( aState ) << " )"  << endl ;
@@ -354,6 +377,8 @@ namespace GraphExecutor {
       bool IsSuspended() ;
       bool IsKilled() ;
       bool IsStopped() ;
+      void IsLoading( bool Loading );
+      bool IsLoading() { return _Loading ; } ;
 
       bool StateWait( SUPERV::GraphState aState ) ;
       bool ReadyWait() ;
@@ -361,7 +386,7 @@ namespace GraphExecutor {
       bool DoneWait() ;
       bool SuspendedWait() ;
 
-      void InitialState( GraphExecutor::OutNode * theOutNode ) ;
+      void InitialState() ;
       bool InitPythonFunctions(bool WithErr ) ;
       void SetWaitingStates(GraphExecutor::InNode * EndNode ) ;
 
@@ -448,6 +473,10 @@ namespace GraphExecutor {
       long PyCpuUsed( bool tot = false ) ;
       void SetPyCpuUsed() ;
       long PyCpu() ;
+
+      bool PyRunSimpleString( char* thePyString );
+      PyObject * PyEvalCallObject( PyObject * MyPyRunMethod ,
+                                   PyObject * ArgsList ) ;
     } ;
 
 } ;