]> SALOME platform Git repositories - modules/superv.git/blob - idl/SUPERV.idl
Salome HOME
*** empty log message ***
[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 , DataStreamParameter } ;
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 /*! Creates an Input port in an Inline node.
318
319 \param aParameterName This value sets the name of the parameter which will be defined in this port.
320 \param aParameterType This value sets the type of the parameter which will be defined in this port.
321 */
322
323     SUPERV::Port InPort( in string aParameterName , in string aParameterType ) ;
324 /*! Creates an Output port in an Inline node.
325
326 \param aParameterName This value sets the name of the parameter which will be defined in this port.
327 \param aParameterType This value sets the type of the parameter which will be defined in this port.
328 */
329
330     SUPERV::Port OutPort( in string aParameterName , in string aParameterType ) ;
331 /*! Creates an Input port in an Inline node.
332
333 \param aParameterName This value sets the name of the parameter which will be defined in this port.
334 \param aParameterType This value sets the type of the parameter which will be defined in this port.
335 */
336
337     SUPERV::Port InDataStreamPort( in string aParameterName , in string aParameterType ) ;
338 /*! Creates an Output port in an Inline node.
339
340 \param aParameterName This value sets the name of the parameter which will be defined in this port.
341 \param aParameterType This value sets the type of the parameter which will be defined in this port.
342 */
343
344     SUPERV::Port OutDataStreamPort( in string aParameterName , in string aParameterType ) ;
345 /*!
346  Enters a value into an Input %Port
347 */
348     SUPERV::Port Input( in string InputParameterName ,
349                         in Value aValue ) ;
350
351
352     // Create an Input %Port and an Output Port in LabelNode or ControlNode
353     //    boolean BusPort( in string InOutParameterName ,
354     //                     in string InOutParameterType ,
355     //                     out SUPERV::Port InputPort ,
356     //                     out SUPERV::Port OutputPort ) ;
357     //    boolean BusPorts( in string InputParameterName ,
358     //                      in string InputParameterType ,
359     //                      in string OutputParameterName ,
360     //                      in string OutputParameterType ,
361     //                      out SUPERV::Port InputPort ,
362     //                      out SUPERV::Port OutputPort ) ;
363
364 /*!
365   Gets a list of ports of the node(graph)
366 */
367     SUPERV::ListOfPorts Ports() ;
368
369 /*! Gets a list of links of a port
370 */
371     SUPERV::ListOfLinks Links() ;
372
373 /*!
374 Returns True if this node is a graph.
375 \note <BR>A node of the graph can also represent in its turn another graph.
376 */
377     boolean IsGraph() ;
378 /*!
379 Returns True if the node appears to be a %computing node.
380 */
381     boolean IsComputing() ;
382 /*!
383 Returns True if the node appears to be a %factory node.
384 */
385     boolean IsFactory() ;
386 /*!
387 Returns True if the node appears to be an %inline node.
388 */
389     boolean IsInLine() ;
390 /*!
391 Returns True if the node appears to be a %GOTO node.
392 */
393     boolean IsGOTO() ;
394 /*!
395 Returns True if the node appears to be a %loop node.
396 */
397     boolean IsLoop() ;
398 /*!
399 Returns True if the node appears to be an %endloop node.
400 */
401     boolean IsEndLoop() ;
402 /*!
403 Returns True if the node appears to be a %switch node.
404 */
405     boolean IsSwitch() ;
406 /*!
407 Returns True if the node appears to be a %endswitch node.
408 */
409     boolean IsEndSwitch() ;
410
411 /*!
412  Returns the number of  subgraphs.
413 */
414     long SubGraph() ;
415
416 /*!
417 Returns the number of threads of the graph.
418 */
419     long Thread() ;
420
421 /*!
422  Returns True if the node(graph) is waiting for Data input
423 */
424     boolean IsWaiting() ;
425
426 /*!
427  Returns True if the node(graph) is ready for execution
428 */
429      boolean IsReady() ;
430
431 /*!
432  Returns True if the node(graph) is currently running
433 */
434     boolean IsRunning() ;
435
436 /*!
437  Returns True if execution is finished
438 */
439
440     boolean IsDone() ;
441 /*!
442  Returns True if execution is suspended
443 */
444
445     boolean IsSuspended() ;
446 /*!
447 Returns the current state of the graph.
448 */
449     SUPERV::GraphState State() ;
450
451 /*!
452  Waits for ready_to_run state, Suspend and return.
453 */
454     boolean ReadyW() ;
455
456 /*! Waits for running state, Suspend and return.
457 */
458     boolean RunningW() ;
459
460 /*! Waits for done state, Suspend and return.
461 */
462     boolean DoneW() ;
463
464 /*! Waits for Suspend state and return.
465 */
466     boolean SuspendedW() ;
467
468     //    boolean Ping();
469
470 /*! Kills execution.
471 <br>
472 If not running : will be killed when ready to run.
473 If running : kills immediatly.
474 */
475     boolean Kill();
476
477 /*! Kills execution.
478 <br>
479 Execution will be killed only just after running (only for nodes).
480 */
481     boolean KillDone();
482
483 /*! Stops execution.
484 <br>
485 If not running : will be stopped when ready to run.
486 If running : stops immediatly
487 */
488     boolean Stop();
489 /*! Suspends execution.
490 <br>
491 If not running : will be Suspended when ready to run. It is used in step-by-step execution.
492 If running : suspends immediatly
493 */
494     boolean Suspend();
495 /*! Suspends execution only just after running.
496 */
497     boolean SuspendDone();
498
499 /*! Resumes execution.
500 <br>
501 If Suspended : running will be continued.
502 If not Suspended : cancels the current ControlState ( Suspend, Kill, ...)
503 */
504     boolean Resume();
505
506 /*!
507  Restarts execution of the node.
508 */
509     boolean ReRun();
510 /*!
511 Restarts execution of the graph beginning from a definite node.
512 */
513     boolean ReRunAt( in string aNodeName );
514
515 /*!
516  Restarts and suspends execution of the node(graph).
517 */
518     boolean ReStart();
519 /*!
520 Restarts and suspends execution of the graph beginning from a definite node.
521 \param aNodeName String parameter defining the name of the node.
522 */
523     boolean ReStartAt( in string aNodeName );
524
525 /*!
526  Returns automaton execution state of the node(graph).
527 */
528     SUPERV::AutomatonState AutoState() ;
529
530     // Control state required : Kill, Suspend, Stop
531 /*!
532  Returns control state of the node(graph).
533 */
534     SUPERV::ControlState Control() ;
535 /*!
536 Clears the control state of the node(graph).
537 */
538     void ControlClear() ;
539
540     boolean ContainerKill();
541 /*!
542 Sets the position of the node in the window.
543 */
544     void Coords( in long X , in long Y ) ;
545 /*!
546 Returns the position of the node along X-axis.
547 */
548     long X() ;
549 /*!
550 Returns the position of the node along Y-axis.
551 */
552     long Y() ;
553 /*!
554 Returns the Cpu used by a node for execution of calculations in seconds.
555 */
556     long CpuUsed() ;
557
558   } ;
559 /*! \brief %FNode class
560
561 This class is necessary for management of factory nodes in a data flow. Besides the inherited methods it contains some methods allowing to define
562 the component from the container, which will be called for execution of the calculation.
563 */
564   //////////////
565   interface FNode : CNode {
566   //////////////
567 /*! Gets the name of the component, which will be called for execution of the calculation.
568 */
569     string GetComponentName() ;
570 /*! Gets the name of the interface of the component.
571 */
572     string GetInterfaceName() ;
573 /*! Gets the container containing the component, which will be called for execution of the calculation.
574 */
575     string GetContainer() ;
576 /*! Sets the name of the component, which will be called for execution of the calculation.
577 \param aComponentName Name of the component.
578 */
579     boolean SetComponentName(in string aComponentName ) ;
580 /*! Sets the name of the interface of the component.
581 \param anInterfaceName Name of the interface.
582 */
583     boolean SetInterfaceName(in string anInterfaceName ) ;
584 /*! Gets the container containing the component, which will be called for execution of the calculation.
585 \param aContainer Container containing the component.
586 */
587     boolean SetContainer(in string aContainer ) ;
588   } ;
589 /*! \brief %INode class
590
591 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
592 executed for performing calculations, as well as input and output parameters for the node.
593 */
594   // InLine Nodes
595   //////////////
596   interface INode : CNode {
597   //////////////
598
599 /*! Sets Python function for the InLine Node.
600 \param FuncName Name of the function
601 \param aPyInitFunction Python initialization function of the InLine Node
602 */
603     void SetPyFunction( in string FuncName ,
604                         in SUPERV::ListOfStrings aPyInitFunction ) ;
605 /*! Returns Python function of the InLine Node.
606 */
607     SUPERV::ListOfStrings PyFunction() ;
608 /*! Returns the name of the Python function of the InLine Node.
609 */
610     string PyFuncName() ;
611
612   } ;
613 /*! \brief %GNode class
614
615 This class is necessary for management of GOTO/EndLoop/EndSwitch nodes in the dataflow.
616 Besides the inherited methods it contains some methods allowing to define the couple node, which will be linked to this one.
617 */
618   // GOTO/EndLoop/EndSwitch Nodes
619   ///////////////
620   interface GNode : INode {
621   ///////////////
622 /*! Sets the coupled InLine Node to this GOTO/EndLoop/EndSwitch Node.
623 */
624     boolean SetCoupled( in string anInLineNode ) ;
625 /*! Returns the coupled InLine Node to this GOTO/EndLoop/EndSwitch Node.
626 */
627     SUPERV::INode Coupled() ;
628   } ;
629 /*! %Loop Nodes class
630 */
631   // Loop Nodes
632   ///////////////
633   interface LNode : GNode {
634   ///////////////
635 /*! Sets Python Init function of the Loop Node.
636 \param InitName Name of the Init function
637 \param aPyInitFunction Python Init function
638 */
639     void SetPyInit( in string InitName ,
640                             in SUPERV::ListOfStrings aPyInitFunction ) ;
641 /*! Returns Python Init function of the Loop Node.
642 */
643     SUPERV::ListOfStrings PyInit() ;
644 /*! Returns the name of the Python Init function of the Loop  Node.
645 */
646     string PyInitName() ;
647
648 /*! Sets Python More function of the Loop Node.
649 \param MoreName Name of the More function
650 \param aPyMoreFunction Python More function
651 */
652     void SetPyMore( in string MoreName ,
653                             in SUPERV::ListOfStrings aPyMoreFunction ) ;
654 /*! Returns Python More function of the Loop Node.
655 */
656     SUPERV::ListOfStrings PyMore() ;
657 /*! Returns the name of the Python More function of the Loop Node.
658 */
659     string PyMoreName() ;
660
661 /*! Sets Python Next function of the Loop Node.
662 \param  NextName Name of the  Next function
663 \param aPy NextFunction Python  Next function
664 */
665     void SetPyNext( in string NextName ,
666                             in SUPERV::ListOfStrings aPyNextFunction ) ;
667
668 /*! Returns Python Next function of the Loop Node.
669 */
670     SUPERV::ListOfStrings PyNext() ;
671 /*! Returns the name of the Python Next function of the Loop Node.
672 */
673     string PyNextName() ;
674
675   } ;
676
677   // EndOfLoop Nodes
678   ////////////////
679   interface ELNode : GNode {
680   ////////////////
681   } ;
682
683   // Switch Nodes
684   ///////////////
685   interface SNode : GNode {
686   ///////////////
687   } ;
688
689   // EndOfSwitch Nodes
690   ////////////////
691   interface ESNode : GNode {
692   ////////////////
693   } ;
694
695 /*! \brief Interface of a graph
696
697 This interface includes a set of methods used for management of the graphs in %SUPERVISION module.
698 */
699
700   ///////////////
701   interface Graph : INode {
702   ///////////////
703
704     /*! Creates a Computing Node in a Graph.
705     */
706     SUPERV::CNode CNode( in SALOME_ModuleCatalog::Service aService ) ;
707
708     /*! Creates a Factory Node in a Graph.
709     */
710     SUPERV::FNode FNode( in string aComponentName ,
711                          in string anInterfaceName ,
712                          in SALOME_ModuleCatalog::Service aService ) ;
713
714     /*! Creates an InLine Node in a Graph.
715     */
716     SUPERV::INode INode( in string FuncName , in ListOfStrings aPythonFunction ) ;
717
718     /*! Creates a GOTO Node and links it to the corresponding InLine node.
719     */
720     SUPERV::GNode GNode( in string FuncName , in ListOfStrings aPythonFunction ,
721                          in string anINode ) ;
722
723     /*! Creates a Loop Node ("for" or "while" loop) and links it to the corresponding end of loop node.
724     */
725     SUPERV::LNode LNode( in string InitName , in ListOfStrings InitFunction ,
726                          in string MoreName , in ListOfStrings MoreFunction ,
727                          in string NextName , in ListOfStrings NextFunction ,
728                          out SUPERV::INode anEndOfLoop ) ;
729
730     /*! Creates a conditional "if/elseif/else" or "switch" node and the corresponding end node
731     */
732     SUPERV::SNode SNode( in string FuncName , in ListOfStrings aPythonFunction ,
733                          out SUPERV::INode anEndOfSwitch ) ;
734
735     /*! Returns an existing node with a definite name.
736     \param aNodeName Name of the Node.
737     */
738     SUPERV::CNode Node( in string aNodeName ) ;
739
740     /*! Creates a CORBA Component Object Reference
741     */
742     Engines::Component ComponentRef( in string aComputerContainer ,
743                                      in string aComponentName ) ;
744
745 /*!
746  Creates a link  connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
747 */
748     SUPERV::Link Link( in SUPERV::Port OutputPort ,
749                        in SUPERV::Port InputPort ) ;
750
751 /*!
752 Imports a graph into a file with XML format
753 \param anXmlFile String parameter defining the name of the XML file.
754 \return True, if the graph has been successfully imported.
755 */
756     boolean Import( in string anXmlFile ) ;
757 /*!
758 Exports a graph from a file with XML format
759 \param anXmlFile String parameter defining the name of the XML file.
760 \return True, if the graph has been successfully imported.
761 */
762     boolean Export( in string anXmlFile ) ;
763 /*!
764 Returns True if the graph is read Only.
765 */
766     boolean IsReadOnly() ;
767
768 /*!
769  Starts asynchronous execution of the graph.
770 */
771     boolean Run() ;
772
773 /*!
774  Assigns to the %Node an %Event and a %State of the %Node, if the Event is
775  available. And returns immediately Nil, NoEvent and NoState if not.
776  Returns false if the graph is finished, suspended, killed or stopped.
777 \param aNode  %Node for which this method is called
778 \param anEvent  An operation, which has been performed on this node(graph).
779 \param aState   Current state of the graph
780 */
781     boolean EventNoW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
782                       out SUPERV::GraphState aState ) ;
783
784 /*!
785  Assigns to the %Node an %Event and a %State of the %Node, if the Event is
786  available. Waits if it is not available at the current moment.
787  Returns false if the graph is finished, suspended, killed or stopped.
788 \param aNode  %Node for which this method is called
789 \param anEvent  An operation, which has been performed on this node(graph).
790 \param aState   Current state of the graph
791 */
792     boolean Event( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
793                    out SUPERV::GraphState aState ) ;
794
795     // Same as Event but execution of the thread is suspended between the
796     // return of EventW and the next call to EventW
797 /*!
798  Assigns to the %Node an %Event and a %State of the %Node, if the Event is
799  available. And returns immediately Nil, NoEvent and NoState if not.
800  Returns false if the graph is finished, suspended, killed or stopped.
801 \note <BR>Execution of the thread is suspended between the return of this
802 method and its next usage.
803 \param aNode  %Node for which this method is called
804 \param anEvent  An operation, which has been performed on this node(graph).
805 \param aState   Current state of the graph
806 */
807     boolean EventW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
808                     out SUPERV::GraphState aState ) ;
809 /*! \name Methods used for inner debugging purposes of threads management :
810 */
811 /*@{*/
812
813     long EventQSize() ;
814     long LevelMax() ;
815     SUPERV::ListOfNodes LevelNodes( in long aLevel ) ;
816     long ThreadsMax() ;
817
818 /*@}*/
819
820 /*!
821 Returns the number of independent subgraphs
822 */
823     long GraphsNumber() ;
824 /*!
825 Returns the number of currently running threads.
826 */
827     long Threads();
828 /*!
829 Returns the number of suspended threads.
830 */
831     long SuspendedThreads();
832 /*!
833 Returns True if the graph is valid.
834 */
835     boolean IsValid() ;
836 /*!
837 Returns True if the graph can be executed.
838 */
839     boolean IsExecutable() ;
840 /*!
841 Returns True if the graph represents a working algorithm.
842 */
843     boolean IsDataFlow() ;
844
845 /*!
846 Returns True if the graph is being currently edited.
847 */
848     boolean IsEditing() ;
849 /*!
850 Returns True if the graph is being currently executed.
851 */
852     boolean IsExecuting() ;
853
854     long LastLevelDone() ;
855
856 /*!
857  Launches step-by-step execution of the graph.
858 \note  The execution is suspended immediatly after performance of operations of the first node and
859 user can specify the nodes, where execution will be again suspended after its resuming.
860 */
861     boolean Start() ;
862 /*!
863 Allows to copy one graph into another.
864 */
865     SUPERV::Graph Copy() ;
866 /*!
867 Merges two graphs
868 */
869     boolean Merge( in Graph aGraph ) ;
870 /*!
871 Returns a list of nodes of the graph.
872 */
873     SUPERV::ListOfNodes Nodes() ;
874 /*!
875 Returns a list of links of the graph.
876 */
877     SUPERV::ListOfLinks GLinks() ;
878 /*!
879 Gets IOR of the garph.
880 */
881     string getIOR();
882
883 /*!
884 Returns a list of graphs.
885 \note  Not implemented
886 */
887     SUPERV::ListOfGraphs Graphs() ;
888
889   } ;
890
891
892
893
894
895 /*! \brief Interface of the %link
896
897 This interface contains a set of methods used for representation and management of the links
898 connecting nodes in a %graph.
899 */
900
901   //////////////
902   interface Link : Engines::Component {
903   //////////////
904 /*!
905 Associates an %Output %Port to the Link
906 */
907     SUPERV::Port OutPort() ;
908
909 /*!
910 Associates an %Input %Port to the Link
911 */
912     SUPERV::Port InPort() ;
913
914     // For GUI :
915 /*! \name Methods used for representation of links in GUI of %SALOME application :
916 */
917 /*@{*/
918 /*!
919 Returns the number of coordinate points which are included in the link.
920 \note  <BR>Every link can contain a set of coordinate points which constitute it. These points have
921 index numbers (beginning from 1) and coordinates defining their position in the window. Indexing of
922 the points starts from input port to output port of the corresponding link.
923 */
924     long CoordsSize() ;
925 /*!
926 Adds a coordinate point to the link.
927 \param index  Index of the point.
928 \param X  Coordinates of the point.
929 \param Y  Coordinates of the point.
930 */
931     boolean AddCoord( in long index , in long X , in long Y ) ;
932 /*!
933 Changes the location of a definite coordinate point of the link.
934 \param index  Index of the point.
935 \param X  Coordinates of the point.
936 \param Y  Coordinates of the point.
937 */
938
939     boolean ChangeCoord( in long index , in long X , in long Y ) ;
940 /*!
941 Removes a coordinate point of the link.
942 \param index  Index of the point.
943 */
944
945     boolean RemoveCoord( in long index ) ;
946
947 /*!
948 Sets the location of a coordinate point of the link.
949 \param index  Index of the point.
950 \param X  Coordinates of the point.
951 \param Y  Coordinates of the point.
952 */
953
954     boolean Coords( in long index , out long X , out long Y ) ;
955 /*@}*/
956
957     //    void Destroy() ;
958
959   } ;
960
961 /*! \brief  %Value interface
962
963 This interface contains a set of methods used for setting initial parameters of the ports
964 */
965
966   ///////////////
967   interface Value : Engines::Component {
968   ///////////////
969 /*!
970 Converts the given value into a value of string type.
971 */
972     string ToString() ;
973 /*!
974 Converts the given value into a value of independant data type.
975 */
976     any ToAny() ;
977 /*!
978 Returns True if the value represents an IOR.
979 */
980     boolean IsIOR() ;
981 /*!
982 Gets data type of the component.
983 */
984     string ComponentDataType() ;
985
986     //    void Destroy() ;
987
988   } ;
989 /*! \brief  %Port interface
990
991 This interface contains a set of methods used for management of the ports.
992 */
993
994   //////////////
995   interface Port : Value {
996   //////////////
997
998 /*!
999   Gives a value to an Input %Port
1000 \param aValue This parameter defines the input value
1001 */
1002     boolean Input( in SUPERV::Value aValue ) ;
1003
1004 /*!
1005 Returns the node of the port
1006 */
1007     SUPERV::CNode Node() ;
1008 /*!
1009 Sets the name of the port.
1010 */
1011     string Name() ;
1012
1013 /* Gets the type of a port.
1014 \return A string defining the type of a port
1015 */
1016
1017     string Type() ;
1018
1019     // Link of an Input Port
1020 /*!
1021 Returns the link of an %Input %Port
1022 */
1023     SUPERV::Link Link() ;
1024
1025 /*!
1026 Returns a list of links of an Input %Port of an EndSwitchNode
1027 */
1028     SUPERV::ListOfLinks Links() ;
1029
1030 /*!
1031 Returns True if this port appears to be an %Input %Port of a Node
1032 */
1033     boolean IsInput() ;
1034
1035 /*!
1036 Returns True if an %Input %Value exists for that %Input %Port (without link)
1037 */
1038     boolean HasInput() ;
1039
1040 /*!
1041 Returns True if the %Port is linked (without value)
1042 */
1043 // Port with link (without Value)
1044     boolean IsLinked() ;
1045
1046     // Kind of a Port
1047 /*! Returns the type of this port.
1048 */
1049     SUPERV::KindOfPort Kind() ;
1050
1051     // SetKind of a Port
1052 /*! Sets the type of this port.
1053 */
1054     void SetKind( in SUPERV::KindOfPort aKindOfPort ) ;
1055
1056     // Port from the service of the node
1057 /*!
1058 Returns True if the %Port is a parameter of a service
1059 */
1060     boolean IsParam() ;
1061     // Port is a Gate of the node
1062 /*!
1063 Returns True if the %Port appears to be a Gate Port of the Node
1064 */
1065     boolean IsGate() ;
1066     // Port is a parameter of an InLineNode
1067 /*!
1068 Returns True if the %Port appears to be a parameter of an InLine Node.
1069 */
1070     boolean IsInLine() ;
1071
1072     // Port is a LoopParameter (InitLoop or DoLoop) of an LoopNode
1073 /*!
1074 Returns True if the %Port appears to be a Loop Parameter (InitLoop or DoLoop) of a Loop Node
1075 */
1076     boolean IsLoop() ;
1077     // Port is an output parameter of a SwitchNode connected to an InGate
1078 /*!
1079 Returns True if the %Port appears to be a parameter of a switch node
1080 */
1081     // Port is a parameter of a switch node
1082     boolean IsSwitch() ;
1083     // Port is an Input parameter of a EndSwitchNode connected to several output ports
1084 /*!
1085 Returns True if the %Port appears to be an EndSwitch Node connected to several output ports.
1086 */
1087     boolean IsEndSwitch() ;
1088
1089     boolean IsDataStream() ;
1090
1091 /*! Returns the current state of the graph.
1092 */
1093     SUPERV::GraphState State() ;
1094 /*! Returns True if calculation is finished.
1095 */
1096     boolean IsDone() ;
1097
1098   } ;
1099
1100 };
1101 #endif