Salome HOME
omniORB4 porting
[modules/superv.git] / idl / SUPERV.idl
index 4d3f195dd846811ad9e32f1a6966f5c4ef2372f4..80ef176f698746e9c7dd6a42de19499ad57348df 100644 (file)
@@ -42,9 +42,15 @@ This enumeration contains a set of elements defining the type of the port.
 \note  <BR>In general, ports represent <STRONG>input or output parameters</STRONG> of the functions,
 implemented in different kinds of nodes of the graph.
 */
-  enum KindOfPort { UndefinedParameter , ServiceParameter , GateParameter ,
-                    InLineParameter , LoopParameter , SwitchParameter ,
-                    EndSwitchParameter , GOTOParameter , DataStreamParameter } ;
+  enum KindOfPort { UndefinedParameter , 
+                   ServiceParameter , 
+                   GateParameter ,
+                    InLineParameter , 
+                   LoopParameter , 
+                   SwitchParameter ,
+                    EndSwitchParameter , 
+                   GOTOParameter , 
+                   DataStreamParameter } ;
 
 /*!
 This enumeration contains a set of dependencies of InPorts and OutPorts.
@@ -74,10 +80,18 @@ This enumeration contains a set of dependencies of Ports.
 /*!
 This enumeration contains a set of elements defining the type of the node.
 */
-  enum KindOfNode { FactoryNode , DataFlowGraph , ComputingNode ,
-                    InLineNode , LoopNode , EndLoopNode ,
-                    SwitchNode , EndSwitchNode , GOTONode , DataStreamGraph ,
-                    UnknownNode };
+  enum KindOfNode { FactoryNode , 
+                   DataFlowGraph , 
+                   ComputingNode ,
+                    InLineNode , 
+                   LoopNode , 
+                   EndLoopNode ,
+                    SwitchNode , 
+                   EndSwitchNode , 
+                   GOTONode , 
+                   DataStreamGraph ,
+                    MacroNode ,
+                   UnknownNode };
 
 /*!
 This struct contains fields defining the date.
@@ -95,26 +109,40 @@ This enumeration contains a set of elements defining the type of operation, whic
 on this node(graph).
 */
 
-  enum GraphEvent { UndefinedEvent , NoEvent , NewThreadEvent ,
-                    WaitingEvent , ReadyEvent ,
-                    RunningEvent , DoneEvent , ErroredEvent ,
-                    SuspendEvent , ResumeEvent ,
-                    KillEvent , StopEvent ,
-                    ReRunEvent , ReStartEvent } ;
+  enum GraphEvent { UndefinedEvent , 
+                   NoEvent , 
+                   NewThreadEvent ,
+                    WaitingEvent , 
+                   ReadyEvent ,
+                    RunningEvent , 
+                   DoneEvent , 
+                   ErroredEvent ,
+                    SuspendEvent , 
+                   ResumeEvent ,
+                    KillEvent , 
+                   StopEvent } ;
 
   // UndefinedState : Non existing Node, Port etc...
 /*!
 This enumeration contains a set of elements defining the current state of the node(graph).
 */
 
-  enum GraphState { UndefinedState , NoState , EditingState , SuspendState ,
-                    WaitingState , ReadyState , SuspendReadyState ,
+  enum GraphState { UndefinedState , 
+                   NoState , 
+                   EditingState , 
+                   SuspendState ,
+                    WaitingState , 
+                   ReadyState , 
+                   SuspendReadyState ,
                     RunningState ,
-                    DoneState , ErrorState ,
-                    SuspendDoneState , SuspendErroredState ,
-                    KillState , StopState ,
-                    ReRunState , ReStartState ,
-                    NumberOfGraphStates } ;
+                    DoneState , 
+                   ErrorState ,
+                    SuspendDoneState , 
+                   SuspendErroredState ,
+                    KillState , 
+                   StopState ,
+                   LoadingState, 
+                   NumberOfGraphStates } ;
 
 /*! A sequence of string values.
 */
@@ -142,8 +170,8 @@ This enumeration contains a set of elements defining the current state of the no
   interface ELNode ;
   interface SNode ;
   interface ESNode ;
-  interface StreamGraph ;
   interface Graph ;
+  interface StreamGraph ;
 
   typedef sequence<CNode>  ListOfCNodes ;
   typedef sequence<FNode>  ListOfFNodes ;
@@ -153,7 +181,7 @@ This enumeration contains a set of elements defining the current state of the no
   typedef sequence<ELNode> ListOfELNodes ;
   typedef sequence<SNode>  ListOfSNodes ;
   typedef sequence<ESNode> ListOfESNodes ;
-  typedef sequence<Graph> ListOfGraphs ;
+  typedef sequence<Graph>  ListOfGraphs ;
 
 /*!
 This struct contains fields defining different types of nodes.
@@ -181,55 +209,14 @@ This enumeration contains a set of elements defining the %ControlState of the no
 The %ControlState gives a possibility to determine the "control actions" which have been done by
 the user (Suspend, SuspendDone, Kill, etc...).
 */
-  enum ControlState { VoidState , ToSuspendStartState ,
-                      ToSuspendState , ToSuspendDoneState ,
-                      ToKillState , ToKillDoneState , ToStopState ,
+  enum ControlState { VoidState , 
+                     ToSuspendStartState ,
+                      ToSuspendState , 
+                     ToSuspendDoneState ,
+                      ToKillState , 
+                     ToKillDoneState , 
+                     ToStopState ,
                       NumberOfControlStates } ;
-/*!
-The AutomatonState is an internal state of the automaton of the Executor
-of the %Supervision %Engine. It is used for inner debugging purposes only.
-*/
-
-  enum AutomatonState { UnKnownState ,
-                        DataUndefState ,
-                        DataWaitingState ,
-                        DataReadyState ,
-                        SuspendedReadyState,
-                        SuspendedReadyToResumeState ,
-                        ResumedReadyState ,
-                        KilledReadyState ,
-                        StoppedReadyState ,
-                        ExecutingState ,
-                        SuspendedExecutingState ,
-                        ResumedExecutingState ,
-                        KilledExecutingState ,
-                        StoppedExecutingState ,
-                        SuccessedExecutingState ,
-                        ErroredExecutingState ,
-                        SuspendedSuccessedState ,
-                        SuspendedErroredState,
-                        ResumedSuccessedState ,
-                        ResumedErroredState ,
-                            KilledSuccessedState ,
-                        KilledErroredState ,
-                            StoppedSuccessedState ,
-                        StoppedErroredState ,
-                        SuccessedState ,
-                        ErroredState ,
-                        SuspendedState ,
-                        KilledState ,
-                        StoppedState ,
-                        SuspendedSuccessedToReStartState ,
-                        SuspendedErroredToReStartState ,
-                        ReRunnedState ,
-                        ReStartedState ,
-                        NumberOfAutomatonStates
-                     } ;
-
-
-
-
-
 
 
 
@@ -240,6 +227,12 @@ This interface contains a set of methods necessary for management of a %graph.
 */
   interface SuperG : Engines::Component, SALOMEDS::Driver {
   ////////////////
+
+//DumpPython is defined in SALOME_Component.idl (SALOMEDS::Driver)
+//    SALOMEDS::TMPFile DumpPython( in SALOMEDS::Study theStudy ,
+//                                  in boolean isPublished ,
+//                                  out boolean isValisScript ) ;
+
 /*!
   Constructs a graph with possibility to read/edit it
   \param aGraph  %aGraphName or %aGraphXmlFile
@@ -289,6 +282,10 @@ Creates a value of <b>any</b> type which will be used for <VAR>Input</VAR> metho
 \param ior String parameter defining %IOR of the graph.
 */
     SUPERV::StreamGraph getStreamGraph(in string ior); // get Graph from is IOR
+/*!
+Returns a duplicate of the object (omniORB4 problem).
+*/
+    Object ToObject( in Object anObject ) ;
 
   };
 
@@ -386,6 +383,11 @@ Allows to update the comments about this node(graph).
 */
     SUPERV::StreamPort GetOutStreamPort( in string aParameterName ) ;
 
+/*!
+ Returns true if a Node (or Graph) has StreamPorts
+*/
+    boolean HasStreamPort() ;
+
 /*!
  Enters a value into an Input %Port
 */
@@ -412,14 +414,35 @@ Allows to update the comments about this node(graph).
 
 /*!
 Returns True if this node is a graph.
-\note <BR>A node of the graph can also represent in its turn another graph.
 */
     boolean IsStreamGraph() ;
 /*!
 Returns True if this node is a graph.
-\note <BR>A node of the graph can also represent in its turn another graph.
 */
     boolean IsGraph() ;
+
+/*!
+Returns True if this node is a MacroNode of a DataFlowGraph or a DataStreamGraph.
+*/
+    boolean IsMacro() ;
+/*!
+Returns True if this node is a MacroNode of a DataFlowGraph.
+*/
+    boolean IsFlowMacro() ;
+/*!
+Returns True if this node is a MacroNode of a DataStreamGraph.
+*/
+    boolean IsStreamMacro() ;
+
+/*!
+Returns True if this node is a Head Graph .
+*/
+    boolean IsHeadGraph() ;
+/*!
+Returns the MacroNode Level of this node.
+*/
+    long GraphLevel() ;
+
 /*!
 Returns True if the node appears to be a %computing node.
 */
@@ -552,31 +575,8 @@ If not Suspended : cancels the current ControlState ( Suspend, Kill, ...)
 */
     boolean Resume();
 
-/*!
- Restarts execution of the node.
-*/
-    boolean ReRun();
-/*!
-Restarts execution of the graph beginning from a definite node.
-*/
-    boolean ReRunAt( in string aNodeName );
 
-/*!
- Restarts and suspends execution of the node(graph).
-*/
-    boolean ReStart();
-/*!
-Restarts and suspends execution of the graph beginning from a definite node.
-\param aNodeName String parameter defining the name of the node.
-*/
-    boolean ReStartAt( in string aNodeName );
-
-/*!
- Returns automaton execution state of the node(graph).
-*/
-    SUPERV::AutomatonState AutoState() ;
-
-    // Control state required : Kill, Suspend, Stop
+// Control state required : Kill, Suspend, Stop
 /*!
  Returns control state of the node(graph).
 */
@@ -587,6 +587,7 @@ Clears the control state of the node(graph).
     void ControlClear() ;
 
     boolean ContainerKill();
+
 /*!
 Sets the position of the node in the window.
 */
@@ -770,7 +771,7 @@ This interface includes a set of methods used for management of the graphs in %S
 */
 
   ///////////////
-  interface Graph : INode {
+  interface Graph : GNode {
   ///////////////
 
     /*! Creates a Computing Node in a Graph.
@@ -804,6 +805,22 @@ This interface includes a set of methods used for management of the graphs in %S
     SUPERV::SNode SNode( in string FuncName , in ListOfStrings aPythonFunction ,
                          out SUPERV::INode anEndOfSwitch ) ;
 
+    /*! Creates a "MacroNode" node which corresponds to a Graph with a xml file
+    */
+    SUPERV::Graph MNode( in string aXmlFileName ) ;
+
+    /*! Creates a "MacroNode" node which corresponds to a Graph with a Graph
+    */
+    SUPERV::Graph GraphMNode( in Graph aGraph ) ;
+
+    /*! Returns a Graph of a "MacroNode" or a "MacroNode" of a Graph
+    */
+    SUPERV::Graph FlowObjRef() ;
+
+    /*! Returns a StreamGraph of a "MacroNode"  or a "MacroNode" of a StreamGraph
+    */
+    SUPERV::StreamGraph StreamObjRef() ;
+
     /*! Returns an existing node with a definite name.
     \param aNodeName Name of the Node.
     */
@@ -814,148 +831,164 @@ This interface includes a set of methods used for management of the graphs in %S
     Engines::Component ComponentRef( in string aComputerContainer ,
                                      in string aComponentName ) ;
 
-/*!
- Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
-*/
+    /*! Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
+     */
     SUPERV::Link Link( in SUPERV::Port OutputPort ,
                        in SUPERV::Port InputPort ) ;
 
-/*!
-Imports a graph into a file with XML format
-\param anXmlFile String parameter defining the name of the XML file.
-\return True, if the graph has been successfully imported.
-*/
+    /*!
+      Give the last error[s] message[s]
+      \return string[s] corresponding to last error[s].
+    */
+    string Messages() ;
+
+    /*!
+      Imports a graph into a file with XML format
+      \param anXmlFile String parameter defining the name of the XML file.
+      \return True, if the graph has been successfully imported.
+    */
     boolean Import( in string anXmlFile ) ;
-/*!
-Exports a graph from a file with XML format
-\param anXmlFile String parameter defining the name of the XML file.
-\return True, if the graph has been successfully imported.
-*/
+
+    /*!
+      Exports a graph to a file with XML format
+      \param anXmlFile String parameter defining the name of the XML file.
+      \return True, if the graph has been successfully exported.
+    */
     boolean Export( in string anXmlFile ) ;
-/*!
-Returns True if the graph is read Only.
-*/
+    
+    /*!
+      Exports a graph to a string in python format
+    */
+    string SavePY( in boolean importSuperV ) ;
+    
+    /*!
+      Returns True if the graph is read Only.
+    */
     boolean IsReadOnly() ;
 
-/*!
- Starts asynchronous execution of the graph.
-*/
+    /*!
     Starts asynchronous execution of the graph.
+    */
     boolean Run() ;
 
-/*!
- Assigns to the %Node an %Event and a %State of the %Node, if the Event is
- available. And returns immediately Nil, NoEvent and NoState if not.
- Returns false if the graph is finished, suspended, killed or stopped.
-\param aNode  %Node for which this method is called
-\param anEvent  An operation, which has been performed on this node(graph).
-\param aState   Current state of the graph
-*/
+    /*!
     Assigns to the %Node an %Event and a %State of the %Node, if the Event is
     available. And returns immediately Nil, NoEvent and NoState if not.
     Returns false if the graph is finished, suspended, killed or stopped.
+      \param aNode  %Node for which this method is called
+      \param anEvent  An operation, which has been performed on this node(graph).
+      \param aState   Current state of the graph
+    */
     boolean EventNoW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
                       out SUPERV::GraphState aState ) ;
 
-/*!
- Assigns to the %Node an %Event and a %State of the %Node, if the Event is
- available. Waits if it is not available at the current moment.
- Returns false if the graph is finished, suspended, killed or stopped.
-\param aNode  %Node for which this method is called
-\param anEvent  An operation, which has been performed on this node(graph).
-\param aState   Current state of the graph
-*/
+    /*!
     Assigns to the %Node an %Event and a %State of the %Node, if the Event is
     available. Waits if it is not available at the current moment.
     Returns false if the graph is finished, suspended, killed or stopped.
+      \param aNode  %Node for which this method is called
+      \param anEvent  An operation, which has been performed on this node(graph).
+      \param aState   Current state of the graph
+    */
     boolean Event( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
                    out SUPERV::GraphState aState ) ;
-
+    
     // Same as Event but execution of the thread is suspended between the
     // return of EventW and the next call to EventW
-/*!
- Assigns to the %Node an %Event and a %State of the %Node, if the Event is
- available. And returns immediately Nil, NoEvent and NoState if not.
- Returns false if the graph is finished, suspended, killed or stopped.
-\note <BR>Execution of the thread is suspended between the return of this
-method and its next usage.
-\param aNode  %Node for which this method is called
-\param anEvent  An operation, which has been performed on this node(graph).
-\param aState   Current state of the graph
-*/
+    /*!
     Assigns to the %Node an %Event and a %State of the %Node, if the Event is
     available. And returns immediately Nil, NoEvent and NoState if not.
     Returns false if the graph is finished, suspended, killed or stopped.
+      \note <BR>Execution of the thread is suspended between the return of this
+      method and its next usage.
+      \param aNode  %Node for which this method is called
+      \param anEvent  An operation, which has been performed on this node(graph).
+      \param aState   Current state of the graph
+    */
     boolean EventW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
                     out SUPERV::GraphState aState ) ;
-/*! \name Methods used for inner debugging purposes of threads management :
-*/
-/*@{*/
-
+    /*! \name Methods used for inner debugging purposes of threads management :
+     */
+    /*@{*/
+    
     long EventQSize() ;
     long LevelMax() ;
     SUPERV::ListOfNodes LevelNodes( in long aLevel ) ;
     long ThreadsMax() ;
+    
+    /*@}*/
 
-/*@}*/
-
-/*!
-Returns the number of currently running threads.
-*/
+    /*!
+      Returns the number of currently running threads.
+    */
     long Threads();
-/*!
-Returns the number of suspended threads.
-*/
+    /*!
+      Returns the number of suspended threads.
+    */
     long SuspendedThreads();
-/*!
-Returns True if the graph is valid.
-*/
+    /*!
+      Returns True if the graph is valid.
+    */
     boolean IsValid() ;
-/*!
-Returns True if the graph can be executed.
-*/
+    /*!
+      Returns True if the graph can be executed.
+    */
     boolean IsExecutable() ;
-/*!
-Returns True if the graph is being currently edited.
-*/
+    /*!
+      Returns True if the graph is being currently edited.
+    */
     boolean IsEditing() ;
-/*!
-Returns True if the graph is being currently executed.
-*/
+    /*!
+      Returns True if the graph is being currently executed.
+    */
     boolean IsExecuting() ;
-
+    
     long LastLevelDone() ;
-
-/*!
- Launches step-by-step execution of the graph.
-\note  The execution is suspended immediatly after performance of operations of the first node and
-user can specify the nodes, where execution will be again suspended after its resuming.
-*/
+    
+    /*!
     Launches step-by-step execution of the graph.
+      \note  The execution is suspended immediatly after performance of operations of the first node and
+      user can specify the nodes, where execution will be again suspended after its resuming.
+    */
     boolean Start() ;
-/*!
-Allows to copy one graph into another.
-*/
+    /*!
+      Allows to copy one graph into another.
+    */
     SUPERV::Graph Copy() ;
-/*!
-Convert a FlowGraph to a StreamGraph.
-*/
+    /*!
+      Convert a FlowGraph to a StreamGraph.
+    */
     SUPERV::StreamGraph ToStreamGraph() ;
-/*!
-Merges two graphs
-*/
+    /*!
+      Merges two graphs
+    */
     boolean Merge( in Graph aGraph ) ;
-/*!
-Returns a list of nodes of the graph.
-*/
+    /*!
+      Returns a list of nodes of the graph.
+    */
     SUPERV::ListOfNodes Nodes() ;
-/*!
-Returns a list of links of the graph.
-*/
+    /*!
+      Returns a list of links of the graph.
+    */
     SUPERV::ListOfLinks GLinks() ;
-/*!
-Gets IOR of the garph.
-*/
+    /*!
+      Gets IOR of the garph.
+    */
     string getIOR();
-
-/*!
-Returns the number of independent subgraphs
-*/
+    
+    /*!
+      Returns the number of independent subgraphs
+    */
     long SubGraphsNumber() ;
-/*!
-Returns a list of Nodes of a SubGraph.
-*/
+    /*!
+      Returns a list of Nodes of a SubGraph.
+    */
     SUPERV::ListOfNodes SubGraphsNodes( in long SubGraphNumber ) ;
 
+    /*! Forces use of Editor's data model and destroy of Executor
+     */
+    void Editing();
+    
   } ;
 
 
@@ -975,6 +1008,14 @@ This interface includes a set of methods used for management of the graphs in %S
 Allows to copy one graph into another.
 */
     SUPERV::StreamGraph StreamCopy() ;
+    /*! Creates a "MacroNode" node which corresponds to a StreamGraph with a xml file
+    */
+    SUPERV::StreamGraph StreamMNode( in string aXmlFileName ) ;
+
+    /*! Creates a "MacroNode" node which corresponds to a StreamGraph with a Graph
+    */
+    SUPERV::StreamGraph StreamGraphMNode( in StreamGraph aStreamGraph ) ;
+
 /*!
  Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
 */
@@ -1082,6 +1123,14 @@ Sets the location of a coordinate point of the link.
 
     //    void Destroy() ;
 
+    /*! Checks if the types of Ports that it connects are compatible
+     */
+    boolean IsValid();
+
+    /*! Check if the Link equals to the another given Link
+     */
+    boolean IsEqual( in SUPERV::Link aLink );
+
   } ;
 
 
@@ -1247,6 +1296,10 @@ Returns True if the %Port appears to be an EndSwitch Node connected to several o
 */
     boolean IsDone() ;
 
+/*! deactivate the objref of a Port when its node is destroyed
+*/
+    void Remove() ;
+
   } ;
 
   ////////////////////