Salome HOME
PAL8176
[modules/superv.git] / idl / SUPERV.idl
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 //  This library is free software; you can redistribute it and/or
5 //  modify it under the terms of the GNU Lesser General Public
6 //  License as published by the Free Software Foundation; either
7 //  version 2.1 of the License.
8 //
9 //  This library is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 //  Lesser General Public License for more details.
13 //
14 //  You should have received a copy of the GNU Lesser General Public
15 //  License along with this library; if not, write to the Free Software
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
19 //
20 //
21 //
22 //  File   : SUPERV.idl
23 //  Author : Jean Rahuel
24 //  $Header:
25
26 /*! \file SUPERV.idl This file contains a set of interfaces of the %SUPERVISION module
27 */
28
29 #ifndef __SUPERV_IDL__
30 #define __SUPERV_IDL__
31
32 #include "SALOME_ModuleCatalog.idl"
33 #include "SALOME_Component.idl"
34 #include "SALOMEDS.idl"
35 /*!
36  The main package of interfaces of %SUPERVISION module
37 */
38 module SUPERV {
39
40 /*!
41 This enumeration contains a set of elements defining the type of the port.
42 \note  <BR>In general, ports represent <STRONG>input or output parameters</STRONG> of the functions,
43 implemented in different kinds of nodes of the graph.
44 */
45   enum KindOfPort { UndefinedParameter , 
46                     ServiceParameter , 
47                     GateParameter ,
48                     InLineParameter , 
49                     LoopParameter , 
50                     SwitchParameter ,
51                     EndSwitchParameter , 
52                     GOTOParameter , 
53                     DataStreamParameter } ;
54
55 /*!
56 This enumeration contains a set of dependencies of InPorts and OutPorts.
57 */
58 //  enum KindOfDependency { UndefinedDependency , TimeDependency , IterationDependency } ;
59
60 /*!
61 This enumeration contains a set of schemas of InPorts.
62 */
63   enum KindOfSchema { SCHENULL , TI , TF , DELTA } ;
64
65 /*!
66 This enumeration contains a set of interpolations of InPorts.
67 */
68   enum KindOfInterpolation { INTERNULL , L0 , L1 } ;
69
70 /*!
71 This enumeration contains a set of extrapolations of InPorts.
72 */
73   enum KindOfExtrapolation { EXTRANULL , E0 , E1 } ;
74
75 /*!
76 This enumeration contains a set of dependencies of Ports.
77 */
78   enum KindOfDataStreamTrace { WithoutTrace , SummaryTrace , DetailedTrace } ;
79
80 /*!
81 This enumeration contains a set of elements defining the type of the node.
82 */
83   enum KindOfNode { FactoryNode , 
84                     DataFlowGraph , 
85                     ComputingNode ,
86                     InLineNode , 
87                     LoopNode , 
88                     EndLoopNode ,
89                     SwitchNode , 
90                     EndSwitchNode , 
91                     GOTONode , 
92                     DataStreamGraph ,
93                     MacroNode ,
94                     UnknownNode };
95
96 /*!
97 This struct contains fields defining the date.
98 */
99   struct SDate {
100     short Second;
101     short Minute;
102     short Hour;
103     short Day;
104     short Month;
105     short Year;
106   };
107 /*!
108 This enumeration contains a set of elements defining the type of operation, which has been performed
109 on this node(graph).
110 */
111
112   enum GraphEvent { UndefinedEvent , 
113                     NoEvent , 
114                     NewThreadEvent ,
115                     WaitingEvent , 
116                     ReadyEvent ,
117                     RunningEvent , 
118                     DoneEvent , 
119                     ErroredEvent ,
120                     SuspendEvent , 
121                     ResumeEvent ,
122                     KillEvent , 
123                     StopEvent } ;
124
125   // UndefinedState : Non existing Node, Port etc...
126 /*!
127 This enumeration contains a set of elements defining the current state of the node(graph).
128 */
129
130   enum GraphState { UndefinedState , 
131                     NoState , 
132                     EditingState , 
133                     SuspendState ,
134                     WaitingState , 
135                     ReadyState , 
136                     SuspendReadyState ,
137                     RunningState ,
138                     DoneState , 
139                     ErrorState ,
140                     SuspendDoneState , 
141                     SuspendErroredState ,
142                     KillState , 
143                     StopState ,
144                     LoadingState, 
145                     NumberOfGraphStates } ;
146
147 /*! A sequence of string values.
148 */
149   typedef sequence<string> ListOfStrings ;
150
151   interface Value ;
152
153   interface Link ;
154   interface StreamLink ;
155
156   typedef sequence<Link> ListOfLinks ;
157   typedef sequence<StreamLink> ListOfStreamLinks ;
158
159   interface Port ;
160   interface StreamPort ;
161
162   typedef sequence<Port> ListOfPorts ;
163   typedef sequence<StreamPort> ListOfStreamPorts ;
164
165   interface CNode ;
166   interface FNode ;
167   interface INode ;
168   interface GNode ;
169   interface LNode ;
170   interface ELNode ;
171   interface SNode ;
172   interface ESNode ;
173   interface Graph ;
174   interface StreamGraph ;
175
176   typedef sequence<CNode>  ListOfCNodes ;
177   typedef sequence<FNode>  ListOfFNodes ;
178   typedef sequence<INode>  ListOfINodes ;
179   typedef sequence<GNode>  ListOfGNodes ;
180   typedef sequence<LNode>  ListOfLNodes ;
181   typedef sequence<ELNode> ListOfELNodes ;
182   typedef sequence<SNode>  ListOfSNodes ;
183   typedef sequence<ESNode> ListOfESNodes ;
184   typedef sequence<Graph>  ListOfGraphs ;
185
186 /*!
187 This struct contains fields defining different types of nodes.
188 */
189
190   struct ListOfNodes {
191     ListOfCNodes  CNodes ;
192     ListOfFNodes  FNodes ;
193     ListOfINodes  INodes ;
194     ListOfGNodes  GNodes ;
195     ListOfLNodes  LNodes ;
196     ListOfELNodes ELNodes ;
197     ListOfSNodes  SNodes ;
198     ListOfESNodes ESNodes ;
199     ListOfGraphs  Graphs ;
200   } ;
201
202   // ToSuspendState : will be Suspended before running if waiting or
203   //                  will be Suspended while running or
204   //                  will be Suspended after run
205   // ToSuspendStartState : will be Suspended at the beginning of execution
206   // ToSuspendDoneState : will be Suspended after run
207 /*!
208 This enumeration contains a set of elements defining the %ControlState of the node.
209 The %ControlState gives a possibility to determine the "control actions" which have been done by
210 the user (Suspend, SuspendDone, Kill, etc...).
211 */
212   enum ControlState { VoidState , 
213                       ToSuspendStartState ,
214                       ToSuspendState , 
215                       ToSuspendDoneState ,
216                       ToKillState , 
217                       ToKillDoneState , 
218                       ToStopState ,
219                       NumberOfControlStates } ;
220
221
222
223   ////////////////
224 /*! \brief interface %SuperG
225
226 This interface contains a set of methods necessary for management of a %graph.
227 */
228   interface SuperG : Engines::Component, SALOMEDS::Driver {
229   ////////////////
230 /*!
231   Constructs a graph with possibility to read/edit it
232   \param aGraph  %aGraphName or %aGraphXmlFile
233 */
234     SUPERV::Graph Graph(in string aGraph ) ; // aGraphName or aGraphXmlFile
235
236 /*!
237   Constructs a read Only graph ( for execution ).
238  \note <BR>In this graph there is also a possibility to update nodes, coordinates of the links,
239   of container names and input data.
240   \param aGraph  %aGraphName or %aGraphXmlFile
241 */
242     SUPERV::Graph GraphE(in string aGraph ) ; // aGraphName or aGraphXmlFile
243
244 /*!
245   Constructs a StreamGraph with possibility to read/edit it
246   \param aGraph  %aGraphName or %aGraphXmlFile
247 */
248     SUPERV::StreamGraph StreamGraph(in string aGraph ) ; // aGraphName or aGraphXmlFile
249
250 /*!
251   Constructs a read Only StreamGraph ( for execution ).
252  \note <BR>In this graph there is also a possibility to update nodes, coordinates of the links,
253   of container names and input data.
254   \param aGraph  %aGraphName or %aGraphXmlFile
255 */
256     SUPERV::StreamGraph StreamGraphE(in string aGraph ) ; // aGraphName or aGraphXmlFile
257
258 /*!
259 Creates a value of <b>string</b> type which will be used for <VAR>Input</VAR> method in the interface %Node.
260 \param aString Input value of string type.
261 */
262     SUPERV::Value StringValue( in string aString ) ;
263 /*!
264 Creates a value of <b>any</b> type which will be used for <VAR>Input</VAR> method in the interface %Node.
265 \param anAny Input value of any type.
266 */
267     SUPERV::Value AnyValue( in any anAny ) ;
268 /*!
269  Gets a graph with a definite %IOR
270 \param ior String parameter defining %IOR of the graph.
271 */
272     SUPERV::Graph getGraph(in string ior); // get Graph from is IOR
273
274 /*!
275  Gets a graph with a definite %IOR
276 \param ior String parameter defining %IOR of the graph.
277 */
278     SUPERV::StreamGraph getStreamGraph(in string ior); // get Graph from is IOR
279
280   };
281
282 /*! \brief %CNode interface
283
284 This is a base class of the SUPERVISION module. It contains a set of methods allowing:
285 <ul>
286     <li>creating a <b>Computation</b> node and setting its parameters (Name, Author, Comments etc.)
287     <li>checking the current state of the node in the data flow
288     <li>node execution follow-up
289     <li>management of the components, which can be initialized for execution of calculations in the data flow. (For that purpose %CNode class inherits the methods of the %Engines:Component class)
290 </ul>
291 */
292
293   //////////////
294   interface CNode : Engines::Component {
295   //////////////
296
297
298 /*!
299 Returns the name of the node(graph).
300 */
301     string Name() ;
302 /*!
303 Returns the service of this node .
304 */
305     SALOME_ModuleCatalog::Service Service() ;
306 /*!
307 Returns the type of the node.
308 */
309     SUPERV::KindOfNode Kind() ;
310 /*!
311 Returns the date of creation of the node(graph).
312 */
313     SUPERV::SDate CreationDate() ;
314 /*!
315 Returns the date of last update of the node(graph).
316 */
317     SUPERV::SDate LastUpdateDate() ;
318 /*!
319 Returns the name of the version of the node(graph).
320 */
321     string Version() ;
322 /*!
323 Returns the name of the author of the node(graph).
324 */
325     string Author() ;
326 /*!
327 Returns the string containing comments about this node(graph).
328 */
329     string Comment() ;
330
331
332 /*!
333 Sets the name of the node(graph).
334 \param aNewName String value defining the name of the node(graph).
335 \return True if the name has been updated.
336 */
337     boolean SetName(in string aNewName ) ;
338 /*!
339 Sets the name of the author. Returns True if it is updated.
340 \param anAuthor String value defining the name of the author.
341 \return True if the name has been updated.
342 */
343     boolean SetAuthor(in string anAuthor ) ;
344 /*!
345 Allows to update the comments about this node(graph).
346 \param aComment String value containing a comment to this node(graph).
347 \return True if the old comment has been updated.
348 */
349     boolean SetComment(in string aComment ) ;
350
351 /*!
352  Gets a port of the node (for compatibility : see GetInPort - GetOutPort).
353 */
354     SUPERV::Port Port( in string aParameterName ) ;
355
356 /*! Gets an Input port in a node.
357 \param aParameterName This value sets the name of the parameter which will be defined in this port.
358 */
359     SUPERV::Port GetInPort( in string aParameterName ) ;
360
361 /*! Gets an Output port in a node.
362 \param aParameterName This value sets the name of the parameter which will be defined in this port.
363 */
364     SUPERV::Port GetOutPort( in string aParameterName ) ;
365
366 /*! Gets an Input StreamPort in a node.
367 \param aParameterName This value sets the name of the parameter which will be defined in this port.
368 */
369     SUPERV::StreamPort GetInStreamPort( in string aParameterName ) ;
370
371 /*! Gets an Output StreamPort in a node.
372 \param aParameterName This value sets the name of the parameter which will be defined in this port.
373 */
374     SUPERV::StreamPort GetOutStreamPort( in string aParameterName ) ;
375
376 /*!
377  Returns true if a Node (or Graph) has StreamPorts
378 */
379     boolean HasStreamPort() ;
380
381 /*!
382  Enters a value into an Input %Port
383 */
384     SUPERV::Port Input( in string InputParameterName ,
385                         in Value aValue ) ;
386
387 /*!
388   Gets a list of ports of the node(graph)
389 */
390     SUPERV::ListOfPorts Ports() ;
391
392 /*!
393   Gets a list of ports of the node(graph)
394 */
395     SUPERV::ListOfStreamPorts StreamPorts() ;
396
397 /*! Gets a list of links of a node(graph)
398 */
399     SUPERV::ListOfLinks Links() ;
400
401 /*! Gets a list of StreamLinks of a node(graph)
402 */
403     SUPERV::ListOfStreamLinks StreamLinks() ;
404
405 /*!
406 Returns True if this node is a graph.
407 */
408     boolean IsStreamGraph() ;
409 /*!
410 Returns True if this node is a graph.
411 */
412     boolean IsGraph() ;
413
414 /*!
415 Returns True if this node is a MacroNode of a DataFlowGraph or a DataStreamGraph.
416 */
417     boolean IsMacro() ;
418 /*!
419 Returns True if this node is a MacroNode of a DataFlowGraph.
420 */
421     boolean IsFlowMacro() ;
422 /*!
423 Returns True if this node is a MacroNode of a DataStreamGraph.
424 */
425     boolean IsStreamMacro() ;
426
427 /*!
428 Returns True if this node is a Head Graph .
429 */
430     boolean IsHeadGraph() ;
431 /*!
432 Returns the MacroNode Level of this node.
433 */
434     long GraphLevel() ;
435
436 /*!
437 Returns True if the node appears to be a %computing node.
438 */
439     boolean IsComputing() ;
440 /*!
441 Returns True if the node appears to be a %factory node.
442 */
443     boolean IsFactory() ;
444 /*!
445 Returns True if the node appears to be an %inline node.
446 */
447     boolean IsInLine() ;
448 /*!
449 Returns True if the node appears to be a %GOTO node.
450 */
451     boolean IsGOTO() ;
452 /*!
453 Returns True if the node appears to be a %loop node.
454 */
455     boolean IsLoop() ;
456 /*!
457 Returns True if the node appears to be an %endloop node.
458 */
459     boolean IsEndLoop() ;
460 /*!
461 Returns True if the node appears to be a %switch node.
462 */
463     boolean IsSwitch() ;
464 /*!
465 Returns True if the node appears to be a %endswitch node.
466 */
467     boolean IsEndSwitch() ;
468
469 /*!
470  Returns the numero of subgraph of a node.
471 */
472     long SubGraph() ;
473 /*!
474  Returns the numero of substreamgraph of a node.
475 */
476     long SubStreamGraph() ;
477
478 /*!
479 Returns the number of threads of the graph.
480 */
481     long Thread() ;
482
483 /*!
484  Returns True if the node(graph) is waiting for Data input
485 */
486     boolean IsWaiting() ;
487
488 /*!
489  Returns True if the node(graph) is ready for execution
490 */
491      boolean IsReady() ;
492
493 /*!
494  Returns True if the node(graph) is currently running
495 */
496     boolean IsRunning() ;
497
498 /*!
499  Returns True if execution is finished
500 */
501
502     boolean IsDone() ;
503 /*!
504  Returns True if execution is suspended
505 */
506
507     boolean IsSuspended() ;
508 /*!
509 Returns the current state of the graph.
510 */
511     SUPERV::GraphState State() ;
512
513 /*!
514  Waits for ready_to_run state, Suspend and return.
515 */
516     boolean ReadyW() ;
517
518 /*! Waits for running state, Suspend and return.
519 */
520     boolean RunningW() ;
521
522 /*! Waits for done state, Suspend and return.
523 */
524     boolean DoneW() ;
525
526 /*! Waits for Suspend state and return.
527 */
528     boolean SuspendedW() ;
529
530     //    boolean Ping();
531
532 /*! Kills execution.
533 <br>
534 If not running : will be killed when ready to run.
535 If running : kills immediatly.
536 */
537     boolean Kill();
538
539 /*! Kills execution.
540 <br>
541 Execution will be killed only just after running (only for nodes).
542 */
543     boolean KillDone();
544
545 /*! Stops execution.
546 <br>
547 If not running : will be stopped when ready to run.
548 If running : stops immediatly
549 */
550     boolean Stop();
551 /*! Suspends execution.
552 <br>
553 If not running : will be Suspended when ready to run. It is used in step-by-step execution.
554 If running : suspends immediatly
555 */
556     boolean Suspend();
557 /*! Suspends execution only just after running.
558 */
559     boolean SuspendDone();
560
561 /*! Resumes execution.
562 <br>
563 If Suspended : running will be continued.
564 If not Suspended : cancels the current ControlState ( Suspend, Kill, ...)
565 */
566     boolean Resume();
567
568
569 // Control state required : Kill, Suspend, Stop
570 /*!
571  Returns control state of the node(graph).
572 */
573     SUPERV::ControlState Control() ;
574 /*!
575 Clears the control state of the node(graph).
576 */
577     void ControlClear() ;
578
579     boolean ContainerKill();
580
581 /*!
582 Sets the position of the node in the window.
583 */
584     void Coords( in long X , in long Y ) ;
585 /*!
586 Returns the position of the node along X-axis.
587 */
588     long X() ;
589 /*!
590 Returns the position of the node along Y-axis.
591 */
592     long Y() ;
593 /*!
594 Returns the Cpu used by a node for execution of calculations in seconds.
595 */
596     long CpuUsed() ;
597
598   } ;
599 /*! \brief %FNode class
600
601 This class is necessary for management of factory nodes in a data flow. Besides the inherited methods it contains some methods allowing to define
602 the component from the container, which will be called for execution of the calculation.
603 */
604   //////////////
605   interface FNode : CNode {
606   //////////////
607 /*! Gets the name of the component, which will be called for execution of the calculation.
608 */
609     string GetComponentName() ;
610 /*! Gets the name of the interface of the component.
611 */
612     string GetInterfaceName() ;
613 /*! Gets the container containing the component, which will be called for execution of the calculation.
614 */
615     string GetContainer() ;
616 /*! Sets the name of the component, which will be called for execution of the calculation.
617 \param aComponentName Name of the component.
618 */
619     boolean SetComponentName(in string aComponentName ) ;
620 /*! Sets the name of the interface of the component.
621 \param anInterfaceName Name of the interface.
622 */
623     boolean SetInterfaceName(in string anInterfaceName ) ;
624 /*! Gets the container containing the component, which will be called for execution of the calculation.
625 \param aContainer Container containing the component.
626 */
627     boolean SetContainer(in string aContainer ) ;
628   } ;
629 /*! \brief %INode class
630
631 This class is necessary for management of inline nodes in a data flow. Besides the inherited methods it contains some methods allowing to set a Python function, which will be
632 executed for performing calculations, as well as input and output parameters for the node.
633 */
634   // InLine Nodes
635   //////////////
636   interface INode : CNode {
637   //////////////
638
639 /*! Sets Python function for the InLine Node.
640 \param FuncName Name of the function
641 \param aPyInitFunction Python initialization function of the InLine Node
642 */
643     void SetPyFunction( in string FuncName ,
644                         in SUPERV::ListOfStrings aPyInitFunction ) ;
645 /*! Returns Python function of the InLine Node.
646 */
647     SUPERV::ListOfStrings PyFunction() ;
648 /*! Returns the name of the Python function of the InLine Node.
649 */
650     string PyFuncName() ;
651
652 /*! Creates an Input port in a node.
653 \param aParameterName This value sets the name of the parameter which will be defined in this port.
654 \param aParameterType This value sets the type of the parameter which will be defined in this port.
655 */
656     SUPERV::Port InPort( in string aParameterName , in string aParameterType ) ;
657 /*! Creates an Output port in an Inline node.
658 \param aParameterName This value sets the name of the parameter which will be defined in this port.
659 \param aParameterType This value sets the type of the parameter which will be defined in this port.
660 */
661     SUPERV::Port OutPort( in string aParameterName , in string aParameterType ) ;
662
663 /*! Creates an Input DataStreamPort in an Inline node.
664 \param aParameterName This value sets the name of the parameter which will be defined in this port.
665 \param aParameterType This value sets the type of the parameter which will be defined in this port.
666 */
667     SUPERV::StreamPort InStreamPort( in string aParameterName , in SALOME_ModuleCatalog::DataStreamType aParameterType , in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
668
669 /*! Creates an Output DataStreamPort in an Inline node.
670 \param aParameterName This value sets the name of the parameter which will be defined in this port.
671 \param aParameterType This value sets the type of the parameter which will be defined in this port.
672 */
673     SUPERV::StreamPort OutStreamPort( in string aParameterName , in SALOME_ModuleCatalog::DataStreamType aParameterType , in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
674
675   } ;
676 /*! \brief %GNode class
677
678 This class is necessary for management of GOTO/EndLoop/EndSwitch nodes in the dataflow.
679 Besides the inherited methods it contains some methods allowing to define the couple node, which will be linked to this one.
680 */
681   // GOTO/EndLoop/EndSwitch Nodes
682   ///////////////
683   interface GNode : INode {
684   ///////////////
685 /*! Sets the coupled InLine Node to this GOTO/EndLoop/EndSwitch Node.
686 */
687     boolean SetCoupled( in string anInLineNode ) ;
688 /*! Returns the coupled InLine Node to this GOTO/EndLoop/EndSwitch Node.
689 */
690     SUPERV::INode Coupled() ;
691   } ;
692 /*! %Loop Nodes class
693 */
694   // Loop Nodes
695   ///////////////
696   interface LNode : GNode {
697   ///////////////
698 /*! Sets Python Init function of the Loop Node.
699 \param InitName Name of the Init function
700 \param aPyInitFunction Python Init function
701 */
702     void SetPyInit( in string InitName ,
703                             in SUPERV::ListOfStrings aPyInitFunction ) ;
704 /*! Returns Python Init function of the Loop Node.
705 */
706     SUPERV::ListOfStrings PyInit() ;
707 /*! Returns the name of the Python Init function of the Loop  Node.
708 */
709     string PyInitName() ;
710
711 /*! Sets Python More function of the Loop Node.
712 \param MoreName Name of the More function
713 \param aPyMoreFunction Python More function
714 */
715     void SetPyMore( in string MoreName ,
716                             in SUPERV::ListOfStrings aPyMoreFunction ) ;
717 /*! Returns Python More function of the Loop Node.
718 */
719     SUPERV::ListOfStrings PyMore() ;
720 /*! Returns the name of the Python More function of the Loop Node.
721 */
722     string PyMoreName() ;
723
724 /*! Sets Python Next function of the Loop Node.
725 \param  NextName Name of the  Next function
726 \param aPy NextFunction Python  Next function
727 */
728     void SetPyNext( in string NextName ,
729                             in SUPERV::ListOfStrings aPyNextFunction ) ;
730
731 /*! Returns Python Next function of the Loop Node.
732 */
733     SUPERV::ListOfStrings PyNext() ;
734 /*! Returns the name of the Python Next function of the Loop Node.
735 */
736     string PyNextName() ;
737
738   } ;
739
740   // EndOfLoop Nodes
741   ////////////////
742   interface ELNode : GNode {
743   ////////////////
744   } ;
745
746   // Switch Nodes
747   ///////////////
748   interface SNode : GNode {
749   ///////////////
750   } ;
751
752   // EndOfSwitch Nodes
753   ////////////////
754   interface ESNode : GNode {
755   ////////////////
756   } ;
757
758 /*! \brief Interface of a graph
759
760 This interface includes a set of methods used for management of the graphs in %SUPERVISION module.
761 */
762
763   ///////////////
764   interface Graph : GNode {
765   ///////////////
766
767     /*! Creates a Computing Node in a Graph.
768     */
769     SUPERV::CNode CNode( in SALOME_ModuleCatalog::Service aService ) ;
770
771     /*! Creates a Factory Node in a Graph.
772     */
773     SUPERV::FNode FNode( in string aComponentName ,
774                          in string anInterfaceName ,
775                          in SALOME_ModuleCatalog::Service aService ) ;
776
777     /*! Creates an InLine Node in a Graph.
778     */
779     SUPERV::INode INode( in string FuncName , in ListOfStrings aPythonFunction ) ;
780
781     /*! Creates a GOTO Node and links it to the corresponding InLine node.
782     */
783     SUPERV::GNode GNode( in string FuncName , in ListOfStrings aPythonFunction ,
784                          in string anINode ) ;
785
786     /*! Creates a Loop Node ("for" or "while" loop) and links it to the corresponding end of loop node.
787     */
788     SUPERV::LNode LNode( in string InitName , in ListOfStrings InitFunction ,
789                          in string MoreName , in ListOfStrings MoreFunction ,
790                          in string NextName , in ListOfStrings NextFunction ,
791                          out SUPERV::INode anEndOfLoop ) ;
792
793     /*! Creates a conditional "if/elseif/else" or "switch" node and the corresponding end node
794     */
795     SUPERV::SNode SNode( in string FuncName , in ListOfStrings aPythonFunction ,
796                          out SUPERV::INode anEndOfSwitch ) ;
797
798     /*! Creates a "MacroNode" node which corresponds to a Graph with a xml file
799     */
800     SUPERV::Graph MNode( in string aXmlFileName ) ;
801
802     /*! Creates a "MacroNode" node which corresponds to a Graph with a Graph
803     */
804     SUPERV::Graph GraphMNode( in Graph aGraph ) ;
805
806     /*! Returns a Graph of a "MacroNode" or a "MacroNode" of a Graph
807     */
808     SUPERV::Graph FlowObjRef() ;
809
810     /*! Returns a StreamGraph of a "MacroNode"  or a "MacroNode" of a StreamGraph
811     */
812     SUPERV::StreamGraph StreamObjRef() ;
813
814     /*! Returns an existing node with a definite name.
815     \param aNodeName Name of the Node.
816     */
817     SUPERV::CNode Node( in string aNodeName ) ;
818
819     /*! Creates a CORBA Component Object Reference
820     */
821     Engines::Component ComponentRef( in string aComputerContainer ,
822                                      in string aComponentName ) ;
823
824     /*! Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
825      */
826     SUPERV::Link Link( in SUPERV::Port OutputPort ,
827                        in SUPERV::Port InputPort ) ;
828
829     /*!
830       Imports a graph into a file with XML format
831       \param anXmlFile String parameter defining the name of the XML file.
832       \return True, if the graph has been successfully imported.
833     */
834     boolean Import( in string anXmlFile ) ;
835
836     /*!
837       Exports a graph from a file with XML format
838       \param anXmlFile String parameter defining the name of the XML file.
839       \return True, if the graph has been successfully imported.
840     */
841     boolean Export( in string anXmlFile ) ;
842     
843     /*!
844       Returns True if the graph is read Only.
845     */
846     boolean IsReadOnly() ;
847
848     /*!
849       Starts asynchronous execution of the graph.
850     */
851     boolean Run() ;
852
853     /*!
854       Assigns to the %Node an %Event and a %State of the %Node, if the Event is
855       available. And returns immediately Nil, NoEvent and NoState if not.
856       Returns false if the graph is finished, suspended, killed or stopped.
857       \param aNode  %Node for which this method is called
858       \param anEvent  An operation, which has been performed on this node(graph).
859       \param aState   Current state of the graph
860     */
861     boolean EventNoW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
862                       out SUPERV::GraphState aState ) ;
863
864     /*!
865       Assigns to the %Node an %Event and a %State of the %Node, if the Event is
866       available. Waits if it is not available at the current moment.
867       Returns false if the graph is finished, suspended, killed or stopped.
868       \param aNode  %Node for which this method is called
869       \param anEvent  An operation, which has been performed on this node(graph).
870       \param aState   Current state of the graph
871     */
872     boolean Event( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
873                    out SUPERV::GraphState aState ) ;
874     
875     // Same as Event but execution of the thread is suspended between the
876     // return of EventW and the next call to EventW
877     /*!
878       Assigns to the %Node an %Event and a %State of the %Node, if the Event is
879       available. And returns immediately Nil, NoEvent and NoState if not.
880       Returns false if the graph is finished, suspended, killed or stopped.
881       \note <BR>Execution of the thread is suspended between the return of this
882       method and its next usage.
883       \param aNode  %Node for which this method is called
884       \param anEvent  An operation, which has been performed on this node(graph).
885       \param aState   Current state of the graph
886     */
887     boolean EventW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
888                     out SUPERV::GraphState aState ) ;
889     /*! \name Methods used for inner debugging purposes of threads management :
890      */
891     /*@{*/
892     
893     long EventQSize() ;
894     long LevelMax() ;
895     SUPERV::ListOfNodes LevelNodes( in long aLevel ) ;
896     long ThreadsMax() ;
897     
898     /*@}*/
899
900     /*!
901       Returns the number of currently running threads.
902     */
903     long Threads();
904     /*!
905       Returns the number of suspended threads.
906     */
907     long SuspendedThreads();
908     /*!
909       Returns True if the graph is valid.
910     */
911     boolean IsValid() ;
912     /*!
913       Returns True if the graph can be executed.
914     */
915     boolean IsExecutable() ;
916     /*!
917       Returns True if the graph is being currently edited.
918     */
919     boolean IsEditing() ;
920     /*!
921       Returns True if the graph is being currently executed.
922     */
923     boolean IsExecuting() ;
924     
925     long LastLevelDone() ;
926     
927     /*!
928       Launches step-by-step execution of the graph.
929       \note  The execution is suspended immediatly after performance of operations of the first node and
930       user can specify the nodes, where execution will be again suspended after its resuming.
931     */
932     boolean Start() ;
933     /*!
934       Allows to copy one graph into another.
935     */
936     SUPERV::Graph Copy() ;
937     /*!
938       Convert a FlowGraph to a StreamGraph.
939     */
940     SUPERV::StreamGraph ToStreamGraph() ;
941     /*!
942       Merges two graphs
943     */
944     boolean Merge( in Graph aGraph ) ;
945     /*!
946       Returns a list of nodes of the graph.
947     */
948     SUPERV::ListOfNodes Nodes() ;
949     /*!
950       Returns a list of links of the graph.
951     */
952     SUPERV::ListOfLinks GLinks() ;
953     /*!
954       Gets IOR of the garph.
955     */
956     string getIOR();
957     
958     /*!
959       Returns the number of independent subgraphs
960     */
961     long SubGraphsNumber() ;
962     /*!
963       Returns a list of Nodes of a SubGraph.
964     */
965     SUPERV::ListOfNodes SubGraphsNodes( in long SubGraphNumber ) ;
966
967     /*! Forces use of Editor's data model and destroy of Executor
968      */
969     void Editing();
970     
971   } ;
972
973
974
975
976
977 /*! \brief Interface of a StreamGraph
978
979 This interface includes a set of methods used for management of the graphs in %SUPERVISION module.
980 */
981
982   /////////////////////
983   interface StreamGraph : Graph {
984   /////////////////////
985
986 /*!
987 Allows to copy one graph into another.
988 */
989     SUPERV::StreamGraph StreamCopy() ;
990     /*! Creates a "MacroNode" node which corresponds to a StreamGraph with a xml file
991     */
992     SUPERV::StreamGraph StreamMNode( in string aXmlFileName ) ;
993
994     /*! Creates a "MacroNode" node which corresponds to a StreamGraph with a Graph
995     */
996     SUPERV::StreamGraph StreamGraphMNode( in StreamGraph aStreamGraph ) ;
997
998 /*!
999  Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
1000 */
1001     SUPERV::StreamLink StreamLink( in SUPERV::StreamPort OutputPort ,
1002                                    in SUPERV::StreamPort InputPort ) ;
1003
1004 /*!
1005 Returns a list of links of the graph.
1006 */
1007     SUPERV::ListOfStreamLinks GStreamLinks() ;
1008     boolean SetStreamParams( in long Timeout ,
1009                              in SUPERV::KindOfDataStreamTrace DataStreamTrace ,
1010                              in double DeltaTime ) ;
1011     void StreamParams( out long Timeout ,
1012                        out SUPERV::KindOfDataStreamTrace DataStreamTrace ,
1013                        out double DeltaTime ) ;
1014
1015 /*!
1016 Returns the number of independent subStreamgraphs
1017 */
1018     long SubStreamGraphsNumber() ;
1019 /*!
1020 Returns a list of Nodes of a SubStreamGraph.
1021 */
1022     SUPERV::ListOfNodes SubStreamGraphsNodes( in long SubStreamGraphNumber ) ;
1023
1024 /*!
1025 Convert a StreamGraph to a FlowGraph.
1026 */
1027     SUPERV::Graph ToFlowGraph() ;
1028
1029 /*!
1030 Merge a StreamGraph.
1031 */
1032     boolean StreamMerge( in StreamGraph aStreamGraph ) ;
1033
1034   } ;
1035
1036
1037
1038
1039
1040
1041 /*! \brief Interface of the %link
1042
1043 This interface contains a set of methods used for representation and management of the links
1044 connecting nodes in a %graph.
1045 */
1046
1047   //////////////
1048   interface Link : Engines::Component {
1049   //////////////
1050 /*!
1051 Returns the %Output %Port of the Link
1052 */
1053     SUPERV::Port OutPort() ;
1054
1055 /*!
1056 Returns the %Input %Port of the Link
1057 */
1058     SUPERV::Port InPort() ;
1059
1060     // For GUI :
1061 /*! \name Methods used for representation of links in GUI of %SALOME application :
1062 */
1063 /*@{*/
1064 /*!
1065 Returns the number of coordinate points which are included in the link.
1066 \note  <BR>Every link can contain a set of coordinate points which constitute it. These points have
1067 index numbers (beginning from 1) and coordinates defining their position in the window. Indexing of
1068 the points starts from input port to output port of the corresponding link.
1069 */
1070     long CoordsSize() ;
1071 /*!
1072 Adds a coordinate point to the link.
1073 \param index  Index of the point.
1074 \param X  Coordinates of the point.
1075 \param Y  Coordinates of the point.
1076 */
1077     boolean AddCoord( in long index , in long X , in long Y ) ;
1078 /*!
1079 Changes the location of a definite coordinate point of the link.
1080 \param index  Index of the point.
1081 \param X  Coordinates of the point.
1082 \param Y  Coordinates of the point.
1083 */
1084
1085     boolean ChangeCoord( in long index , in long X , in long Y ) ;
1086 /*!
1087 Removes a coordinate point of the link.
1088 \param index  Index of the point.
1089 */
1090
1091     boolean RemoveCoord( in long index ) ;
1092
1093 /*!
1094 Sets the location of a coordinate point of the link.
1095 \param index  Index of the point.
1096 \param X  Coordinates of the point.
1097 \param Y  Coordinates of the point.
1098 */
1099
1100     boolean Coords( in long index , out long X , out long Y ) ;
1101 /*@}*/
1102
1103     //    void Destroy() ;
1104
1105     /*! Checks if the types of Ports that it connects are compatible
1106      */
1107     boolean IsValid();
1108
1109     /*! Check if the Link equals to the another given Link
1110      */
1111     boolean IsEqual( in SUPERV::Link aLink );
1112
1113   } ;
1114
1115
1116
1117
1118
1119
1120 /*! \brief Interface of the %link
1121
1122 This interface contains a set of methods used for representation and management of the links
1123 connecting nodes in a %graph.
1124 */
1125
1126   ////////////////////
1127   interface StreamLink : Link {
1128   ////////////////////
1129 /*!
1130 Returns the %Output %StreamPort of the StreamLink
1131 */
1132     SUPERV::StreamPort OutStreamPort() ;
1133
1134 /*!
1135 Returns the %Input %StreamPort of the StreamLink
1136 */
1137     SUPERV::StreamPort InStreamPort() ;
1138
1139
1140   } ;
1141
1142
1143
1144
1145
1146 /*! \brief  %Value interface
1147
1148 This interface contains a set of methods used for setting initial parameters of the ports
1149 */
1150
1151   ///////////////
1152   interface Value : Engines::Component {
1153   ///////////////
1154 /*!
1155 Converts the given value into a value of string type.
1156 */
1157     string ToString() ;
1158 /*!
1159 Converts the given value into a value of independant data type.
1160 */
1161     any ToAny() ;
1162 /*!
1163 Returns True if the value represents an IOR.
1164 */
1165     boolean IsIOR() ;
1166 /*!
1167 Gets data type of the component.
1168 */
1169     string ComponentDataType() ;
1170
1171     //    void Destroy() ;
1172
1173   } ;
1174 /*! \brief  %Port interface
1175
1176 This interface contains a set of methods used for management of the ports.
1177 */
1178
1179   //////////////
1180   interface Port : Value {
1181   //////////////
1182
1183 /*!
1184   Gives a value to an Input %Port
1185 \param aValue This parameter defines the input value
1186 */
1187     boolean Input( in SUPERV::Value aValue ) ;
1188
1189 /*!
1190 Returns the node of the port
1191 */
1192     SUPERV::CNode Node() ;
1193 /*!
1194 Sets the name of the port.
1195 */
1196     string Name() ;
1197
1198 /* Gets the type of a port.
1199 \return A string defining the type of a port
1200 */
1201
1202     string Type() ;
1203
1204     // Link of an Input Port
1205 /*!
1206 Returns the link of an %Input %Port
1207 */
1208     SUPERV::Link Link() ;
1209
1210 /*!
1211 Returns a list of links of an Input %Port of an EndSwitchNode
1212 */
1213     SUPERV::ListOfLinks Links() ;
1214
1215 /*!
1216 Returns True if this port appears to be an %Input %Port of a Node
1217 */
1218     boolean IsInput() ;
1219
1220 /*!
1221 Returns True if an %Input %Value exists for that %Input %Port (without link)
1222 */
1223     boolean HasInput() ;
1224
1225 /*!
1226 Returns True if the %Port is linked (without value)
1227 */
1228 // Port with link (without Value)
1229     boolean IsLinked() ;
1230
1231     // Kind of a Port
1232 /*! Returns the type of this port.
1233 */
1234     SUPERV::KindOfPort Kind() ;
1235
1236     // Port from the service of the node
1237 /*!
1238 Returns True if the %Port is a parameter of a service
1239 */
1240     boolean IsParam() ;
1241     // Port is a Gate of the node
1242 /*!
1243 Returns True if the %Port appears to be a Gate Port of the Node
1244 */
1245     boolean IsGate() ;
1246     // Port is a parameter of an InLineNode
1247 /*!
1248 Returns True if the %Port appears to be a parameter of an InLine Node.
1249 */
1250     boolean IsInLine() ;
1251
1252     // Port is a LoopParameter (InitLoop or DoLoop) of an LoopNode
1253 /*!
1254 Returns True if the %Port appears to be a Loop Parameter (InitLoop or DoLoop) of a Loop Node
1255 */
1256     boolean IsLoop() ;
1257     // Port is an output parameter of a SwitchNode connected to an InGate
1258 /*!
1259 Returns True if the %Port appears to be a parameter of a switch node
1260 */
1261     // Port is a parameter of a switch node
1262     boolean IsSwitch() ;
1263     // Port is an Input parameter of a EndSwitchNode connected to several output ports
1264 /*!
1265 Returns True if the %Port appears to be an EndSwitch Node connected to several output ports.
1266 */
1267     boolean IsEndSwitch() ;
1268
1269     boolean IsDataStream() ;
1270
1271 /*! Returns the current state of the port.
1272 */
1273     SUPERV::GraphState State() ;
1274 /*! Returns True if computation is finished.
1275 */
1276     boolean IsDone() ;
1277
1278 /*! deactivate the objref of a Port when its node is destroyed
1279 */
1280     void Remove() ;
1281
1282   } ;
1283
1284   ////////////////////
1285   interface StreamPort : Port {
1286   ////////////////////
1287
1288     // Link of a StreamPort
1289 /*!
1290 Returns the link of a %StreamPort
1291 */
1292     SUPERV::StreamLink StreamLink() ;
1293
1294 /*! Returns the current Dependency of the DataStreamPort : TimeDependency or IterationDependency
1295 */
1296     SALOME_ModuleCatalog::DataStreamDependency Dependency() ;
1297     boolean SetDependency( in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
1298
1299 /*! Sets or Returns the current kinds of Schema, Interpolation and Extrapolation of the InDataStreamPort
1300 */
1301     boolean SetParams( in KindOfSchema aKindOfSchema ,
1302                        in KindOfInterpolation aKindOfInterpolation ,
1303                        in KindOfExtrapolation aKindOfExtrapolation ) ;
1304     boolean Params( out KindOfSchema aKindOfSchema ,
1305                     out KindOfInterpolation aKindOfInterpolation ,
1306                     out KindOfExtrapolation aKindOfExtrapolation ) ;
1307
1308 /*! Sets or Returns the current number of values ("NIVEAU") of the OutDataStreamPort
1309 */
1310     boolean SetNumberOfValues( in long aNumberOfValues ) ;
1311     long NumberOfValues() ;
1312
1313   } ;
1314
1315 };
1316 #endif