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