Salome HOME
MPV: Merge V1_2d
[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 , ServiceParameter , GateParameter ,
46                     InLineParameter , LoopParameter , SwitchParameter ,
47                     EndSwitchParameter , GOTOParameter } ;
48
49 /*!
50 This enumeration contains a set of elements defining the type of the node.
51 */
52   enum KindOfNode { FactoryNode , DataFlowNode , ComputingNode ,
53                     InLineNode , LoopNode , EndLoopNode ,
54                     SwitchNode , EndSwitchNode , GOTONode , UnknownNode };
55
56 /*!
57 This struct contains fields defining the date.
58 */
59   struct SDate {
60     short Second;
61     short Minute;
62     short Hour;
63     short Day;
64     short Month;
65     short Year;
66   };
67 /*!
68 This enumeration contains a set of elements defining the type of operation, which has been performed
69 on this node(graph).
70 */
71
72   enum GraphEvent { UndefinedEvent , NoEvent , NewThreadEvent ,
73                     WaitingEvent , ReadyEvent ,
74                     RunningEvent , DoneEvent , ErroredEvent ,
75                     SuspendEvent , ResumeEvent ,
76                     KillEvent , StopEvent ,
77                     ReRunEvent , ReStartEvent } ;
78
79   // UndefinedState : Non existing Node, Port etc...
80 /*!
81 This enumeration contains a set of elements defining the current state of the node(graph).
82 */
83
84   enum GraphState { UndefinedState , NoState , EditingState , SuspendState ,
85                     WaitingState , ReadyState , SuspendReadyState ,
86                     RunningState ,
87                     DoneState , ErrorState ,
88                     SuspendDoneState , SuspendErroredState ,
89                     KillState , StopState ,
90                     ReRunState , ReStartState ,
91                     NumberOfGraphStates } ;
92
93 /*! A sequence of string values.
94 */
95   typedef sequence<string> ListOfStrings ;
96
97   interface Value ;
98
99   interface Link ;
100
101   typedef sequence<Link> ListOfLinks ;
102
103   interface Port ;
104
105   typedef sequence<Port> ListOfPorts ;
106
107   interface CNode ;
108   interface FNode ;
109   interface INode ;
110   interface GNode ;
111   interface LNode ;
112   interface ELNode ;
113   interface SNode ;
114   interface ESNode ;
115   typedef sequence<CNode>  ListOfCNodes ;
116   typedef sequence<FNode>  ListOfFNodes ;
117   typedef sequence<INode>  ListOfINodes ;
118   typedef sequence<GNode>  ListOfGNodes ;
119   typedef sequence<LNode>  ListOfLNodes ;
120   typedef sequence<ELNode> ListOfELNodes ;
121   typedef sequence<SNode>  ListOfSNodes ;
122   typedef sequence<ESNode> ListOfESNodes ;
123 /*!
124 This struct contains fields defining different types of nodes.
125 */
126
127   struct ListOfNodes {
128     ListOfCNodes  CNodes ;
129     ListOfFNodes  FNodes ;
130     ListOfINodes  INodes ;
131     ListOfGNodes  GNodes ;
132     ListOfLNodes  LNodes ;
133     ListOfELNodes ELNodes ;
134     ListOfSNodes  SNodes ;
135     ListOfESNodes ESNodes ;
136   } ;
137
138   interface Graph ;
139
140   typedef sequence<Graph> ListOfGraphs ;
141
142   // ToSuspendState : will be Suspended before running if waiting or
143   //                  will be Suspended while running or
144   //                  will be Suspended after run
145   // ToSuspendStartState : will be Suspended at the beginning of execution
146   // ToSuspendDoneState : will be Suspended after run
147 /*!
148 This enumeration contains a set of elements defining the %ControlState of the node.
149 The %ControlState gives a possibility to determine the "control actions" which have been done by
150 the user (Suspend, SuspendDone, Kill, etc...).
151 */
152   enum ControlState { VoidState , ToSuspendStartState ,
153                       ToSuspendState , ToSuspendDoneState ,
154                       ToKillState , ToKillDoneState , ToStopState ,
155                       NumberOfControlStates } ;
156 /*!
157 The AutomatonState is an internal state of the automaton of the Executor
158 of the %Supervision %Engine. It is used for inner debugging purposes only.
159 */
160
161   enum AutomatonState { UnKnownState ,
162                         DataUndefState ,
163                         DataWaitingState ,
164                         DataReadyState ,
165                         SuspendedReadyState,
166                         SuspendedReadyToResumeState ,
167                         ResumedReadyState ,
168                         KilledReadyState ,
169                         StoppedReadyState ,
170                         ExecutingState ,
171                         SuspendedExecutingState ,
172                         ResumedExecutingState ,
173                         KilledExecutingState ,
174                         StoppedExecutingState ,
175                         SuccessedExecutingState ,
176                         ErroredExecutingState ,
177                         SuspendedSuccessedState ,
178                         SuspendedErroredState,
179                         ResumedSuccessedState ,
180                         ResumedErroredState ,
181                              KilledSuccessedState ,
182                         KilledErroredState ,
183                              StoppedSuccessedState ,
184                         StoppedErroredState ,
185                         SuccessedState ,
186                         ErroredState ,
187                         SuspendedState ,
188                         KilledState ,
189                         StoppedState ,
190                         SuspendedSuccessedToReStartState ,
191                         SuspendedErroredToReStartState ,
192                         ReRunnedState ,
193                         ReStartedState ,
194                         NumberOfAutomatonStates
195                      } ;
196
197
198
199
200
201
202
203
204   ////////////////
205 /*! \brief interface %SuperG
206
207 This interface contains a set of methods necessary for management of a %graph.
208 */
209   interface SuperG : Engines::Component, SALOMEDS::Driver {
210   ////////////////
211 /*!
212   Constructs a graph with possibility to read/edit it
213   \param aGraph  %aGraphName or %aGraphXmlFile
214 */
215     SUPERV::Graph Graph(in string aGraph ) ; // aGraphName or aGraphXmlFile
216
217 /*!
218   Constructs a read Only graph ( for execution ).
219  \note <BR>In this graph there is also a possibility to update nodes, coordinates of the links,
220   of container names and input data.
221   \param aGraph  %aGraphName or %aGraphXmlFile
222 */
223     SUPERV::Graph GraphE(in string aGraph ) ; // aGraphName or aGraphXmlFile
224
225 /*!
226 Creates a value of <b>string</b> type which will be used for <VAR>Input</VAR> method in the interface %Node.
227 \param aString Input value of string type.
228 */
229     SUPERV::Value StringValue( in string aString ) ;
230 /*!
231 Creates a value of <b>any</b> type which will be used for <VAR>Input</VAR> method in the interface %Node.
232 \param anAny Input value of any type.
233 */
234     SUPERV::Value AnyValue( in any anAny ) ;
235 /*!
236  Gets a graph with a definite %IOR
237 \param ior String parameter defining %IOR of the graph.
238 */
239     SUPERV::Graph getGraph(in string ior); // get Graph from is IOR
240
241   };
242
243 /*! \brief %CNode interface
244
245 This is a base class of the SUPERVISION module. It contains a set of methods allowing:
246 <ul>
247     <li>creating a <b>Computation</b> node and setting its parameters (Name, Author, Comments etc.)
248     <li>checking the current state of the node in the data flow
249     <li>node execution follow-up
250     <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)
251 </ul>
252 */
253
254   //////////////
255   interface CNode : Engines::Component {
256   //////////////
257
258
259 /*!
260 Returns the name of the node(graph).
261 */
262     string Name() ;
263 /*!
264 Returns the service of this node .
265 */
266     SALOME_ModuleCatalog::Service Service() ;
267 /*!
268 Returns the type of the node.
269 */
270     SUPERV::KindOfNode Kind() ;
271 /*!
272 Returns the date of creation of the node(graph).
273 */
274     SUPERV::SDate CreationDate() ;
275 /*!
276 Returns the date of last update of the node(graph).
277 */
278     SUPERV::SDate LastUpdateDate() ;
279 /*!
280 Returns the name of the version of the node(graph).
281 */
282     string Version() ;
283 /*!
284 Returns the name of the author of the node(graph).
285 */
286     string Author() ;
287 /*!
288 Returns the string containing comments about this node(graph).
289 */
290     string Comment() ;
291
292
293 /*!
294 Sets the name of the node(graph).
295 \param aNewName String value defining the name of the node(graph).
296 \return True if the name has been updated.
297 */
298     boolean SetName(in string aNewName ) ;
299 /*!
300 Sets the name of the author. Returns True if it is updated.
301 \param anAuthor String value defining the name of the author.
302 \return True if the name has been updated.
303 */
304     boolean SetAuthor(in string anAuthor ) ;
305 /*!
306 Allows to update the comments about this node(graph).
307 \param aComment String value containing a comment to this node(graph).
308 \return True if the old comment has been updated.
309 */
310     boolean SetComment(in string aComment ) ;
311
312 /*!
313  Gets a port of the node.
314 */
315     SUPERV::Port Port( in string aParameterName ) ;
316
317 /*!
318  Enters a value into an Input %Port
319 */
320     SUPERV::Port Input( in string InputParameterName ,
321                         in Value aValue ) ;
322
323
324     // Create an Input %Port and an Output Port in LabelNode or ControlNode
325     //    boolean BusPort( in string InOutParameterName ,
326     //                     in string InOutParameterType ,
327     //                     out SUPERV::Port InputPort ,
328     //                     out SUPERV::Port OutputPort ) ;
329     //    boolean BusPorts( in string InputParameterName ,
330     //                      in string InputParameterType ,
331     //                      in string OutputParameterName ,
332     //                      in string OutputParameterType ,
333     //                      out SUPERV::Port InputPort ,
334     //                      out SUPERV::Port OutputPort ) ;
335
336 /*!
337   Gets a list of ports of the node(graph)
338 */
339     SUPERV::ListOfPorts Ports() ;
340
341 /*! Gets a list of links of a port
342 */
343     SUPERV::ListOfLinks Links() ;
344
345 /*!
346 Returns True if this node is a graph.
347 \note <BR>A node of the graph can also represent in its turn another graph.
348 */
349     boolean IsGraph() ;
350 /*!
351 Returns True if the node appears to be a %computing node.
352 */
353     boolean IsComputing() ;
354 /*!
355 Returns True if the node appears to be a %factory node.
356 */
357     boolean IsFactory() ;
358 /*!
359 Returns True if the node appears to be an %inline node.
360 */
361     boolean IsInLine() ;
362 /*!
363 Returns True if the node appears to be a %GOTO node.
364 */
365     boolean IsGOTO() ;
366 /*!
367 Returns True if the node appears to be a %loop node.
368 */
369     boolean IsLoop() ;
370 /*!
371 Returns True if the node appears to be an %endloop node.
372 */
373     boolean IsEndLoop() ;
374 /*!
375 Returns True if the node appears to be a %switch node.
376 */
377     boolean IsSwitch() ;
378 /*!
379 Returns True if the node appears to be a %endswitch node.
380 */
381     boolean IsEndSwitch() ;
382
383 /*!
384  Returns the number of  subgraphs.
385 */
386     long SubGraph() ;
387
388 /*!
389 Returns the number of threads of the graph.
390 */
391     long Thread() ;
392
393 /*!
394  Returns True if the node(graph) is waiting for Data input
395 */
396     boolean IsWaiting() ;
397
398 /*!
399  Returns True if the node(graph) is ready for execution
400 */
401      boolean IsReady() ;
402
403 /*!
404  Returns True if the node(graph) is currently running
405 */
406     boolean IsRunning() ;
407
408 /*!
409  Returns True if execution is finished
410 */
411
412     boolean IsDone() ;
413 /*!
414  Returns True if execution is suspended
415 */
416
417     boolean IsSuspended() ;
418 /*!
419 Returns the current state of the graph.
420 */
421     SUPERV::GraphState State() ;
422
423 /*!
424  Waits for ready_to_run state, Suspend and return.
425 */
426     boolean ReadyW() ;
427
428 /*! Waits for running state, Suspend and return.
429 */
430     boolean RunningW() ;
431
432 /*! Waits for done state, Suspend and return.
433 */
434     boolean DoneW() ;
435
436 /*! Waits for Suspend state and return.
437 */
438     boolean SuspendedW() ;
439
440     //    boolean Ping();
441
442 /*! Kills execution.
443 <br>
444 If not running : will be killed when ready to run.
445 If running : kills immediatly.
446 */
447     boolean Kill();
448
449 /*! Kills execution.
450 <br>
451 Execution will be killed only just after running (only for nodes).
452 */
453     boolean KillDone();
454
455 /*! Stops execution.
456 <br>
457 If not running : will be stopped when ready to run.
458 If running : stops immediatly
459 */
460     boolean Stop();
461 /*! Suspends execution.
462 <br>
463 If not running : will be Suspended when ready to run. It is used in step-by-step execution.
464 If running : suspends immediatly
465 */
466     boolean Suspend();
467 /*! Suspends execution only just after running.
468 */
469     boolean SuspendDone();
470
471 /*! Resumes execution.
472 <br>
473 If Suspended : running will be continued.
474 If not Suspended : cancels the current ControlState ( Suspend, Kill, ...)
475 */
476     boolean Resume();
477
478 /*!
479  Restarts execution of the node.
480 */
481     boolean ReRun();
482 /*!
483 Restarts execution of the graph beginning from a definite node.
484 */
485     boolean ReRunAt( in string aNodeName );
486
487 /*!
488  Restarts and suspends execution of the node(graph).
489 */
490     boolean ReStart();
491 /*!
492 Restarts and suspends execution of the graph beginning from a definite node.
493 \param aNodeName String parameter defining the name of the node.
494 */
495     boolean ReStartAt( in string aNodeName );
496
497 /*!
498  Returns automaton execution state of the node(graph).
499 */
500     SUPERV::AutomatonState AutoState() ;
501
502     // Control state required : Kill, Suspend, Stop
503 /*!
504  Returns control state of the node(graph).
505 */
506     SUPERV::ControlState Control() ;
507 /*!
508 Clears the control state of the node(graph).
509 */
510     void ControlClear() ;
511
512     boolean ContainerKill();
513 /*!
514 Sets the position of the node in the window.
515 */
516     void Coords( in long X , in long Y ) ;
517 /*!
518 Returns the position of the node along X-axis.
519 */
520     long X() ;
521 /*!
522 Returns the position of the node along Y-axis.
523 */
524     long Y() ;
525 /*!
526 Returns the Cpu used by a node for execution of calculations in seconds.
527 */
528     long CpuUsed() ;
529
530   } ;
531 /*! \brief %FNode class
532
533 This class is necessary for management of factory nodes in a data flow. Besides the inherited methods it contains some methods allowing to define
534 the component from the container, which will be called for execution of the calculation.
535 */
536   //////////////
537   interface FNode : CNode {
538   //////////////
539 /*! Gets the name of the component, which will be called for execution of the calculation.
540 */
541     string GetComponentName() ;
542 /*! Gets the name of the interface of the component.
543 */
544     string GetInterfaceName() ;
545 /*! Gets the container containing the component, which will be called for execution of the calculation.
546 */
547     string GetContainer() ;
548 /*! Sets the name of the component, which will be called for execution of the calculation.
549 \param aComponentName Name of the component.
550 */
551     boolean SetComponentName(in string aComponentName ) ;
552 /*! Sets the name of the interface of the component.
553 \param anInterfaceName Name of the interface.
554 */
555     boolean SetInterfaceName(in string anInterfaceName ) ;
556 /*! Gets the container containing the component, which will be called for execution of the calculation.
557 \param aContainer Container containing the component.
558 */
559     boolean SetContainer(in string aContainer ) ;
560   } ;
561 /*! \brief %INode class
562
563 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
564 executed for performing calculations, as well as input and output parameters for the node.
565 */
566   // InLine Nodes
567   //////////////
568   interface INode : CNode {
569   //////////////
570
571 /*! Sets Python function for the InLine Node.
572 \param FuncName Name of the function
573 \param aPyInitFunction Python initialization function of the InLine Node
574 */
575     void SetPyFunction( in string FuncName ,
576                         in SUPERV::ListOfStrings aPyInitFunction ) ;
577 /*! Returns Python function of the InLine Node.
578 */
579     SUPERV::ListOfStrings PyFunction() ;
580 /*! Returns the name of the Python function of the InLine Node.
581 */
582     string PyFuncName() ;
583
584 /*! Creates an Input port in an Inline node.
585
586 \param aParameterName This value sets the name of the parameter which will be defined in this port.
587 \param aParameterType This value sets the type of the parameter which will be defined in this port.
588 */
589
590     SUPERV::Port InPort( in string aParameterName , in string aParameterType ) ;
591 /*! Creates an Output port in an Inline node.
592
593 \param aParameterName This value sets the name of the parameter which will be defined in this port.
594 \param aParameterType This value sets the type of the parameter which will be defined in this port.
595 */
596
597     SUPERV::Port OutPort( in string aParameterName , in string aParameterType ) ;
598   } ;
599 /*! \brief %GNode class
600
601 This class is necessary for management of GOTO/EndLoop/EndSwitch nodes in the dataflow.
602 Besides the inherited methods it contains some methods allowing to define the couple node, which will be linked to this one.
603 */
604   // GOTO/EndLoop/EndSwitch Nodes
605   ///////////////
606   interface GNode : INode {
607   ///////////////
608 /*! Sets the coupled InLine Node to this GOTO/EndLoop/EndSwitch Node.
609 */
610     boolean SetCoupled( in string anInLineNode ) ;
611 /*! Returns the coupled InLine Node to this GOTO/EndLoop/EndSwitch Node.
612 */
613     SUPERV::INode Coupled() ;
614   } ;
615 /*! %Loop Nodes class
616 */
617   // Loop Nodes
618   ///////////////
619   interface LNode : GNode {
620   ///////////////
621 /*! Sets Python Init function of the Loop Node.
622 \param InitName Name of the Init function
623 \param aPyInitFunction Python Init function
624 */
625     void SetPyInit( in string InitName ,
626                             in SUPERV::ListOfStrings aPyInitFunction ) ;
627 /*! Returns Python Init function of the Loop Node.
628 */
629     SUPERV::ListOfStrings PyInit() ;
630 /*! Returns the name of the Python Init function of the Loop  Node.
631 */
632     string PyInitName() ;
633
634 /*! Sets Python More function of the Loop Node.
635 \param MoreName Name of the More function
636 \param aPyMoreFunction Python More function
637 */
638     void SetPyMore( in string MoreName ,
639                             in SUPERV::ListOfStrings aPyMoreFunction ) ;
640 /*! Returns Python More function of the Loop Node.
641 */
642     SUPERV::ListOfStrings PyMore() ;
643 /*! Returns the name of the Python More function of the Loop Node.
644 */
645     string PyMoreName() ;
646
647 /*! Sets Python Next function of the Loop Node.
648 \param  NextName Name of the  Next function
649 \param aPy NextFunction Python  Next function
650 */
651     void SetPyNext( in string NextName ,
652                             in SUPERV::ListOfStrings aPyNextFunction ) ;
653
654 /*! Returns Python Next function of the Loop Node.
655 */
656     SUPERV::ListOfStrings PyNext() ;
657 /*! Returns the name of the Python Next function of the Loop Node.
658 */
659     string PyNextName() ;
660
661   } ;
662
663   // EndOfLoop Nodes
664   ////////////////
665   interface ELNode : GNode {
666   ////////////////
667   } ;
668
669   // Switch Nodes
670   ///////////////
671   interface SNode : GNode {
672   ///////////////
673   } ;
674
675   // EndOfSwitch Nodes
676   ////////////////
677   interface ESNode : GNode {
678   ////////////////
679   } ;
680
681 /*! \brief Interface of a graph
682
683 This interface includes a set of methods used for management of the graphs in %SUPERVISION module.
684 */
685
686   ///////////////
687   interface Graph : INode {
688   ///////////////
689
690     /*! Creates a Computing Node in a Graph.
691     */
692     SUPERV::CNode CNode( in SALOME_ModuleCatalog::Service aService ) ;
693
694     /*! Creates a Factory Node in a Graph.
695     */
696     SUPERV::FNode FNode( in string aComponentName ,
697                          in string anInterfaceName ,
698                          in SALOME_ModuleCatalog::Service aService ) ;
699
700     /*! Creates an InLine Node in a Graph.
701     */
702     SUPERV::INode INode( in string FuncName , in ListOfStrings aPythonFunction ) ;
703
704     /*! Creates a GOTO Node and links it to the corresponding InLine node.
705     */
706     SUPERV::GNode GNode( in string FuncName , in ListOfStrings aPythonFunction ,
707                          in string anINode ) ;
708
709     /*! Creates a Loop Node ("for" or "while" loop) and links it to the corresponding end of loop node.
710     */
711     SUPERV::LNode LNode( in string InitName , in ListOfStrings InitFunction ,
712                          in string MoreName , in ListOfStrings MoreFunction ,
713                          in string NextName , in ListOfStrings NextFunction ,
714                          out SUPERV::INode anEndOfLoop ) ;
715
716     /*! Creates a conditional "if/elseif/else" or "switch" node and the corresponding end node
717     */
718     SUPERV::SNode SNode( in string FuncName , in ListOfStrings aPythonFunction ,
719                          out SUPERV::INode anEndOfSwitch ) ;
720
721     /*! Returns an existing node with a definite name.
722     \param aNodeName Name of the Node.
723     */
724     SUPERV::CNode Node( in string aNodeName ) ;
725
726     /*! Creates a CORBA Component Object Reference
727     */
728     Engines::Component ComponentRef( in string aComputerContainer ,
729                                      in string aComponentName ) ;
730
731 /*!
732  Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
733 */
734     SUPERV::Link Link( in SUPERV::Port OutputPort ,
735                        in SUPERV::Port InputPort ) ;
736
737 /*!
738 Imports a graph into a file with XML format
739 \param anXmlFile String parameter defining the name of the XML file.
740 \return True, if the graph has been successfully imported.
741 */
742     boolean Import( in string anXmlFile ) ;
743 /*!
744 Exports a graph from a file with XML format
745 \param anXmlFile String parameter defining the name of the XML file.
746 \return True, if the graph has been successfully imported.
747 */
748     boolean Export( in string anXmlFile ) ;
749 /*!
750 Returns True if the graph is read Only.
751 */
752     boolean IsReadOnly() ;
753
754 /*!
755  Starts asynchronous execution of the graph.
756 */
757     boolean Run() ;
758
759 /*!
760  Assigns to the %Node an %Event and a %State of the %Node, if the Event is
761  available. And returns immediately Nil, NoEvent and NoState if not.
762  Returns false if the graph is finished, suspended, killed or stopped.
763 \param aNode  %Node for which this method is called
764 \param anEvent  An operation, which has been performed on this node(graph).
765 \param aState   Current state of the graph
766 */
767     boolean EventNoW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
768                       out SUPERV::GraphState aState ) ;
769
770 /*!
771  Assigns to the %Node an %Event and a %State of the %Node, if the Event is
772  available. Waits if it is not available at the current moment.
773  Returns false if the graph is finished, suspended, killed or stopped.
774 \param aNode  %Node for which this method is called
775 \param anEvent  An operation, which has been performed on this node(graph).
776 \param aState   Current state of the graph
777 */
778     boolean Event( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
779                    out SUPERV::GraphState aState ) ;
780
781     // Same as Event but execution of the thread is suspended between the
782     // return of EventW and the next call to EventW
783 /*!
784  Assigns to the %Node an %Event and a %State of the %Node, if the Event is
785  available. And returns immediately Nil, NoEvent and NoState if not.
786  Returns false if the graph is finished, suspended, killed or stopped.
787 \note <BR>Execution of the thread is suspended between the return of this
788 method and its next usage.
789 \param aNode  %Node for which this method is called
790 \param anEvent  An operation, which has been performed on this node(graph).
791 \param aState   Current state of the graph
792 */
793     boolean EventW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
794                     out SUPERV::GraphState aState ) ;
795 /*! \name Methods used for inner debugging purposes of threads management :
796 */
797 /*@{*/
798
799     long EventQSize() ;
800     long LevelMax() ;
801     SUPERV::ListOfNodes LevelNodes( in long aLevel ) ;
802     long ThreadsMax() ;
803
804 /*@}*/
805
806 /*!
807 Returns the number of independent subgraphs
808 */
809     long GraphsNumber() ;
810 /*!
811 Returns the number of currently running threads.
812 */
813     long Threads();
814 /*!
815 Returns the number of suspended threads.
816 */
817     long SuspendedThreads();
818 /*!
819 Returns True if the graph is valid.
820 */
821     boolean IsValid() ;
822 /*!
823 Returns True if the graph can be executed.
824 */
825     boolean IsExecutable() ;
826 /*!
827 Returns True if the graph represents a working algorithm.
828 */
829     boolean IsDataFlow() ;
830
831 /*!
832 Returns True if the graph is being currently edited.
833 */
834     boolean IsEditing() ;
835 /*!
836 Returns True if the graph is being currently executed.
837 */
838     boolean IsExecuting() ;
839
840     long LastLevelDone() ;
841
842 /*!
843  Launches step-by-step execution of the graph.
844 \note  The execution is suspended immediatly after performance of operations of the first node and
845 user can specify the nodes, where execution will be again suspended after its resuming.
846 */
847     boolean Start() ;
848 /*!
849 Allows to copy one graph into another.
850 */
851     SUPERV::Graph Copy() ;
852 /*!
853 Merges two graphs
854 */
855     boolean Merge( in Graph aGraph ) ;
856 /*!
857 Returns a list of nodes of the graph.
858 */
859     SUPERV::ListOfNodes Nodes() ;
860 /*!
861 Returns a list of links of the graph.
862 */
863     SUPERV::ListOfLinks GLinks() ;
864 /*!
865 Gets IOR of the garph.
866 */
867     string getIOR();
868
869 /*!
870 Returns a list of graphs.
871 \note  Not implemented
872 */
873     SUPERV::ListOfGraphs Graphs() ;
874
875   } ;
876
877
878
879
880
881 /*! \brief Interface of the %link
882
883 This interface contains a set of methods used for representation and management of the links
884 connecting nodes in a %graph.
885 */
886
887   //////////////
888   interface Link : Engines::Component {
889   //////////////
890 /*!
891 Associates an %Output %Port to the Link
892 */
893     SUPERV::Port OutPort() ;
894
895 /*!
896 Associates an %Input %Port to the Link
897 */
898     SUPERV::Port InPort() ;
899
900     // For GUI :
901 /*! \name Methods used for representation of links in GUI of %SALOME application :
902 */
903 /*@{*/
904 /*!
905 Returns the number of coordinate points which are included in the link.
906 \note  <BR>Every link can contain a set of coordinate points which constitute it. These points have
907 index numbers (beginning from 1) and coordinates defining their position in the window. Indexing of
908 the points starts from input port to output port of the corresponding link.
909 */
910     long CoordsSize() ;
911 /*!
912 Adds a coordinate point to the link.
913 \param index  Index of the point.
914 \param X  Coordinates of the point.
915 \param Y  Coordinates of the point.
916 */
917     boolean AddCoord( in long index , in long X , in long Y ) ;
918 /*!
919 Changes the location of a definite coordinate point of the link.
920 \param index  Index of the point.
921 \param X  Coordinates of the point.
922 \param Y  Coordinates of the point.
923 */
924
925     boolean ChangeCoord( in long index , in long X , in long Y ) ;
926 /*!
927 Removes a coordinate point of the link.
928 \param index  Index of the point.
929 */
930
931     boolean RemoveCoord( in long index ) ;
932
933 /*!
934 Sets the location of a coordinate point of the link.
935 \param index  Index of the point.
936 \param X  Coordinates of the point.
937 \param Y  Coordinates of the point.
938 */
939
940     boolean Coords( in long index , out long X , out long Y ) ;
941 /*@}*/
942
943     //    void Destroy() ;
944
945   } ;
946
947 /*! \brief  %Value interface
948
949 This interface contains a set of methods used for setting initial parameters of the ports
950 */
951
952   ///////////////
953   interface Value : Engines::Component {
954   ///////////////
955 /*!
956 Converts the given value into a value of string type.
957 */
958     string ToString() ;
959 /*!
960 Converts the given value into a value of independant data type.
961 */
962     any ToAny() ;
963 /*!
964 Returns True if the value represents an IOR.
965 */
966     boolean IsIOR() ;
967 /*!
968 Gets data type of the component.
969 */
970     string ComponentDataType() ;
971
972     //    void Destroy() ;
973
974   } ;
975 /*! \brief  %Port interface
976
977 This interface contains a set of methods used for management of the ports.
978 */
979
980   //////////////
981   interface Port : Value {
982   //////////////
983
984 /*!
985   Gives a value to an Input %Port
986 \param aValue This parameter defines the input value
987 */
988     boolean Input( in SUPERV::Value aValue ) ;
989
990 /*!
991 Returns the node of the port
992 */
993     SUPERV::CNode Node() ;
994 /*!
995 Sets the name of the port.
996 */
997     string Name() ;
998
999 /* Gets the type of a port.
1000 \return A string defining the type of a port
1001 */
1002
1003     string Type() ;
1004
1005     // Link of an Input Port
1006 /*!
1007 Returns the link of an %Input %Port
1008 */
1009     SUPERV::Link Link() ;
1010
1011 /*!
1012 Returns a list of links of an Input %Port of an EndSwitchNode
1013 */
1014     SUPERV::ListOfLinks Links() ;
1015
1016 /*!
1017 Returns True if this port appears to be an %Input %Port of a Node
1018 */
1019     boolean IsInput() ;
1020
1021 /*!
1022 Returns True if an %Input %Value exists for that %Input %Port (without link)
1023 */
1024     boolean HasInput() ;
1025
1026 /*!
1027 Returns True if the %Port is linked (without value)
1028 */
1029 // Port with link (without Value)
1030     boolean IsLinked() ;
1031
1032     // Kind of a Port
1033 /*! Returns the type of this port.
1034 */
1035     SUPERV::KindOfPort Kind() ;
1036
1037     // Port from the service of the node
1038 /*!
1039 Returns True if the %Port is a parameter of a service
1040 */
1041     boolean IsParam() ;
1042     // Port is a Gate of the node
1043 /*!
1044 Returns True if the %Port appears to be a Gate Port of the Node
1045 */
1046     boolean IsGate() ;
1047     // Port is a parameter of an InLineNode
1048 /*!
1049 Returns True if the %Port appears to be a parameter of an InLine Node.
1050 */
1051     boolean IsInLine() ;
1052
1053     // Port is a LoopParameter (InitLoop or DoLoop) of an LoopNode
1054 /*!
1055 Returns True if the %Port appears to be a Loop Parameter (InitLoop or DoLoop) of a Loop Node
1056 */
1057     boolean IsLoop() ;
1058     // Port is an output parameter of a SwitchNode connected to an InGate
1059 /*!
1060 Returns True if the %Port appears to be a parameter of a switch node
1061 */
1062     // Port is a parameter of a switch node
1063     boolean IsSwitch() ;
1064     // Port is an Input parameter of a EndSwitchNode connected to several output ports
1065 /*!
1066 Returns True if the %Port appears to be an EndSwitch Node connected to several output ports.
1067 */
1068     boolean IsEndSwitch() ;
1069
1070 /*! Returns the current state of the graph.
1071 */
1072     SUPERV::GraphState State() ;
1073 /*! Returns True if calculation is finished.
1074 */
1075     boolean IsDone() ;
1076
1077   } ;
1078
1079 };
1080 #endif