]> SALOME platform Git repositories - modules/superv.git/blob - src/Supervision/CNode_Impl.hxx
Salome HOME
DCQ : Merge with Ecole_Ete_a6.
[modules/superv.git] / src / Supervision / CNode_Impl.hxx
1 //  SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : CNode_Impl.hxx
8 //  Author : Jean Rahuel
9 //  Module : SUPERV
10 //  $Header: 
11
12 #ifndef _CNODE_IMPL_HXX_
13 #define _CNODE_IMPL_HXX_
14
15 #include <iostream>
16
17 #include "CORBA.h"
18
19 #include <SALOMEconfig.h>
20 #include "SALOME_Component_i.hxx"
21 #include "SALOME_LifeCycleCORBA.hxx"
22
23 #include "DataFlowEditor_DataFlow.hxx"
24 #include "DataFlowExecutor_DataFlow.hxx"
25
26 class CNode_Impl : public POA_SUPERV::CNode ,
27                    public Engines_Component_i  {
28   private:
29
30     CORBA::ORB_ptr             _Orb ;
31     PortableServer::POA_ptr    _Poa ;
32     PortableServer::ObjectId * _ContId ;
33
34     GraphEditor::DataFlow * _DataFlowEditor ;
35     GraphEditor::InNode   * _DataFlowNode ;
36     bool _IsNode ;
37
38   public:
39     CNode_Impl();
40     CNode_Impl( CORBA::ORB_ptr orb ,
41                 PortableServer::POA_ptr poa ,
42                 PortableServer::ObjectId * contId , 
43                 const char *instanceName ,
44                 const char *interfaceName ,
45                 const char *aDataFlowName ) ;
46     CNode_Impl( CORBA::ORB_ptr orb ,
47                 PortableServer::POA_ptr poa ,
48                 PortableServer::ObjectId * contId , 
49                 const char *instanceName ,
50                 const char *interfaceName ,
51                 GraphEditor::DataFlow * DataFlowEditor ,
52                 const SALOME_ModuleCatalog::Service &NodeService ,
53                 const char * NodeName = NULLSTRING ,
54                 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::ComputingNode ,
55                 const char * aFuncName = NULLSTRING ,
56                 const SUPERV::ListOfStrings & aPythonFunction = SUPERV::ListOfStrings() ) ;
57     CNode_Impl( CORBA::ORB_ptr orb ,
58                 PortableServer::POA_ptr poa ,
59                 PortableServer::ObjectId * contId , 
60                 const char *instanceName ,
61                 const char *interfaceName ,
62                 GraphEditor::DataFlow * DataFlowEditor ,
63                 const SALOME_ModuleCatalog::Service &NodeService ,
64                 const char * NodeName = NULLSTRING ,
65                 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::InLineNode ,
66                 const GraphBase::ListOfFuncName & aFuncName = GraphBase::ListOfFuncName() ,
67                 const GraphBase::ListOfPythonFunctions & aPythonFunction = GraphBase::ListOfPythonFunctions() ) ;
68     CNode_Impl( CORBA::ORB_ptr orb ,
69                 PortableServer::POA_ptr poa ,
70                 PortableServer::ObjectId * contId , 
71                 const char *instanceName ,
72                 const char *interfaceName ,
73                 GraphEditor::DataFlow * DataFlowEditor ,
74                 GraphEditor::InNode * DataFlowNode ) ;
75     virtual ~CNode_Impl() ;
76     virtual void destroy() ;
77     virtual bool Delete() ;
78
79     virtual void DataFlowEditor( GraphEditor::DataFlow * DataFlowEditor ) {
80             _DataFlowEditor = DataFlowEditor ; } ;
81     virtual GraphEditor::DataFlow * DataFlowEditor() {
82             return _DataFlowEditor ; } ;
83     virtual void DataFlowNode( GraphEditor::InNode * DataFlowNode ) {
84             _DataFlowNode = DataFlowNode ; } ;
85     virtual GraphEditor::InNode * DataFlowNode() {
86             return _DataFlowNode ; } ;
87
88     virtual char * Name() ;
89     virtual bool SetName( const char * aDataFlowName ) ;
90     virtual SALOME_ModuleCatalog::Service * Service() ;
91     virtual SUPERV::KindOfNode Kind() ;
92     virtual SUPERV::SDate CreationDate() ;
93     virtual SUPERV::SDate LastUpdateDate() ;
94     virtual char * Version() ;
95     virtual char * Author() ;
96     virtual bool SetAuthor( const char * aDataFlowAuthor ) ;
97     virtual char * Comment() ;
98     virtual bool SetComment( const char * aDataFlowComment ) ;
99
100     virtual GraphEditor::InNode * DataFlowNode() const {
101             return _DataFlowNode ; } ;
102     virtual GraphBase::ComputingNode * BaseNode() {
103             return _DataFlowNode->ComputingNode() ; } ;
104
105     virtual SUPERV::CNode_var ObjRef() {
106             SUPERV::CNode_var iobject = SUPERV::GNode::_nil() ;
107             if ( _DataFlowNode && _IsNode ) {
108               iobject = SUPERV::CNode::_narrow( _DataFlowNode->ObjRef() ) ;
109             }
110             else {
111               iobject = SUPERV::CNode::_narrow( _DataFlowEditor->Graph()->ObjRef() ) ;
112             }
113             return iobject ; } ;
114     virtual void SetObjRef(SUPERV::CNode_var aNode ) {
115             if ( _DataFlowNode && _IsNode ) {
116               _DataFlowNode->SetObjRef( aNode ) ;
117             }
118             else {
119               _DataFlowEditor->Graph()->SetObjRef( SUPERV::Graph::_narrow( aNode ) ) ;
120             }
121           } ;
122
123     virtual void Coords( const long X , const long Y ) ;
124     virtual long X() ;
125     virtual long Y() ;
126
127     virtual SUPERV::Port_ptr Port( const char * aParameterName ) ;
128
129 //    virtual bool BusPorts( const char * InputParameterName ,
130 //                           const char * InputParameterType ,
131 //                           const char * OutputParameterName ,
132 //                           const char * OutputParameterType ,
133 //                           SUPERV::Port_out InputPort ,
134 //                           SUPERV::Port_out OutputPort ) ;
135
136 //    virtual SUPERV::Link_ptr Link( const char * ToServiceParameterName ,
137 //                                    const SUPERV::Value_ptr aValue ) ;
138
139     virtual SUPERV::Port_ptr Input( const char * ToServiceParameterName ,
140                                     const SUPERV::Value_ptr aValue ) ;
141
142     virtual SUPERV::Port_ptr GetInPort( const char * aParameterName ) ;
143     virtual SUPERV::Port_ptr GetOutPort( const char * aParameterName ) ;
144
145     virtual SUPERV::StreamPort_ptr GetInStreamPort( const char * aParameterName ) ;
146     virtual SUPERV::StreamPort_ptr GetOutStreamPort( const char * aParameterName ) ;
147
148     virtual SUPERV::ListOfPorts * Ports() ;
149     virtual SUPERV::ListOfStreamPorts * StreamPorts() ;
150
151     virtual SUPERV::ListOfLinks * Links() ;
152     virtual SUPERV::ListOfStreamLinks * StreamLinks() ;
153
154     virtual SUPERV::Link_ptr GetLink( const char * ToServiceParameterName ) ;
155     virtual SUPERV::StreamLink_ptr GetStreamLink( const char * ToServiceParameterName ) ;
156
157     virtual bool IsStreamGraph() ;
158     virtual bool IsGraph() ;
159     virtual bool IsComputing() ;
160     virtual bool IsFactory() ;
161     virtual bool IsInLine() ;
162     virtual bool IsGOTO() ;
163     virtual bool IsLoop() ;
164     virtual bool IsEndLoop() ;
165     virtual bool IsSwitch() ;
166     virtual bool IsEndSwitch() ;
167
168     virtual long SubGraph() ;
169     virtual long SubStreamGraph() ;
170
171     virtual bool IsLinked(const char * ToServiceParameterName ) ;
172     virtual bool HasInput(const char * ToServiceParameterName ) ;
173
174 //    virtual SUPERV::Link_ptr GetLink(const char * ToServiceParameterName ) ;
175 //    virtual SUPERV::Value_ptr GetValue(const char * FromServiceParameterName ) ;
176
177     virtual bool IsReady() ;
178     virtual bool IsWaiting() ;
179     virtual bool IsRunning() ;
180     virtual bool IsDone() ;
181     virtual bool IsSuspended() ;
182
183     virtual SUPERV::GraphState State() ;
184     virtual SUPERV::ControlState Control() ;
185     virtual void ControlClear() ;
186
187     virtual long Thread() ;
188
189     virtual SUPERV::AutomatonState AutoState() ;
190
191     virtual bool ReadyW() ;
192     virtual bool RunningW() ;
193     virtual bool DoneW() ;
194     virtual bool SuspendedW() ;
195
196     virtual void ping() ;
197     virtual bool ContainerKill() ;
198
199     virtual bool Kill() ;
200     virtual bool KillDone() ;
201     virtual bool Stop() ;
202     virtual bool Suspend() ;
203     virtual bool SuspendDone() ;
204     virtual bool Resume() ;
205
206     virtual bool Run() ;
207     virtual bool ReRun() ;
208     virtual bool ReRunAt( const char * aNodeName ) ;
209     virtual bool ReStart() ;
210     virtual bool ReStartAt( const char * aNodeName ) ;
211
212     virtual long CpuUsed() ;
213
214 } ;
215
216 #endif