1 // SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : CNode_Impl.hxx
8 // Author : Jean Rahuel
12 #ifndef _CNODE_IMPL_HXX_
13 #define _CNODE_IMPL_HXX_
19 #include <SALOMEconfig.h>
20 #include "SALOME_Component_i.hxx"
21 #include "SALOME_LifeCycleCORBA.hxx"
23 #include "DataFlowEditor_DataFlow.hxx"
24 #include "DataFlowExecutor_DataFlow.hxx"
26 class CNode_Impl : public POA_SUPERV::CNode ,
27 public Engines_Component_i {
31 PortableServer::POA_ptr _Poa ;
32 PortableServer::ObjectId * _ContId ;
34 GraphEditor::DataFlow * _DataFlowEditor ;
35 GraphEditor::InNode * _DataFlowNode ;
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 const SUPERV::KindOfNode aKindOfNode ) ;
47 CNode_Impl( CORBA::ORB_ptr orb ,
48 PortableServer::POA_ptr poa ,
49 PortableServer::ObjectId * contId ,
50 const char *instanceName ,
51 const char *interfaceName ,
52 GraphEditor::DataFlow * DataFlowEditor ,
53 const SALOME_ModuleCatalog::Service &NodeService ,
54 const char * NodeName = NULLSTRING ,
55 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::ComputingNode ,
56 const char * aFuncName = NULLSTRING ,
57 const SUPERV::ListOfStrings & aPythonFunction = SUPERV::ListOfStrings() ,
58 bool isCimpl = true ) ; // mkr : PAL11273 : C++ implementation by default
59 CNode_Impl( CORBA::ORB_ptr orb ,
60 PortableServer::POA_ptr poa ,
61 PortableServer::ObjectId * contId ,
62 const char *instanceName ,
63 const char *interfaceName ,
64 GraphEditor::DataFlow * DataFlowEditor ,
65 const SALOME_ModuleCatalog::Service &NodeService ,
66 const char * NodeName = NULLSTRING ,
67 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::InLineNode ,
68 const GraphBase::ListOfFuncName & aFuncName = GraphBase::ListOfFuncName() ,
69 const GraphBase::ListOfPythonFunctions & aPythonFunction = GraphBase::ListOfPythonFunctions() ) ;
70 CNode_Impl( CORBA::ORB_ptr orb ,
71 PortableServer::POA_ptr poa ,
72 PortableServer::ObjectId * contId ,
73 const char *instanceName ,
74 const char *interfaceName ,
75 GraphEditor::DataFlow * DataFlowEditor ,
76 GraphEditor::InNode * DataFlowNode ) ;
77 virtual ~CNode_Impl() ;
78 virtual void destroy() ;
79 virtual bool Delete() ;
83 virtual void DataFlowEditor( GraphEditor::DataFlow * DataFlowEditor ) {
84 _DataFlowEditor = DataFlowEditor ; } ;
85 virtual GraphEditor::DataFlow * DataFlowEditor() {
86 return _DataFlowEditor ; } ;
88 virtual GraphExecutor::DataFlow * DataFlowExecutor() {
89 return DataFlowEditor()->Executor(); } ;
91 virtual void DataFlowNode( GraphEditor::InNode * DataFlowNode ) {
92 _DataFlowNode = DataFlowNode ; } ;
93 virtual GraphEditor::InNode * DataFlowNode() {
94 return _DataFlowNode ; } ;
96 virtual char * Name() ;
97 virtual bool SetName( const char * aDataFlowName ) ;
98 virtual SALOME_ModuleCatalog::Service * Service() ;
99 virtual SUPERV::KindOfNode Kind() ;
100 virtual SUPERV::SDate CreationDate() ;
101 virtual SUPERV::SDate LastUpdateDate() ;
102 virtual char * Version() ;
103 virtual char * Author() ;
104 virtual bool SetAuthor( const char * aDataFlowAuthor ) ;
105 virtual char * Comment() ;
106 virtual bool SetComment( const char * aDataFlowComment ) ;
108 virtual GraphEditor::InNode * DataFlowNode() const {
109 return _DataFlowNode ; } ;
110 virtual GraphBase::ComputingNode * BaseNode() {
111 return DataFlowNode()->ComputingNode() ; } ;
113 virtual SUPERV::CNode_var ObjRef() {
114 SUPERV::CNode_var iobject = SUPERV::GNode::_nil() ;
115 if ( DataFlowNode() && _IsNode ) {
116 iobject = SUPERV::CNode::_narrow( DataFlowNode()->ObjRef() ) ;
119 iobject = SUPERV::CNode::_narrow( DataFlowEditor()->Graph()->ObjRef() ) ;
122 virtual void SetObjRef(SUPERV::CNode_var aNode ) {
123 if ( DataFlowNode() && _IsNode ) {
124 DataFlowNode()->SetObjRef( aNode ) ;
127 if ( DataFlowEditor() ) {
128 DataFlowEditor()->Graph()->SetObjRef( SUPERV::Graph::_narrow( aNode ) ) ;
130 if ( DataFlowExecutor() ) {
131 DataFlowExecutor()->Graph()->SetObjRef( SUPERV::Graph::_narrow( aNode ) ) ;
137 virtual CNode_Impl * ObjImpl() {
138 CNode_Impl * objimpl = NULL ;
139 if ( DataFlowNode() && _IsNode ) {
140 objimpl = DataFlowNode()->ObjImpl() ;
143 objimpl = DataFlowEditor()->Graph()->ObjImpl() ;
146 virtual void SetObjImpl( CNode_Impl * objimpl ) {
147 if ( DataFlowNode() && _IsNode ) {
148 DataFlowNode()->SetObjImpl( objimpl ) ;
151 if ( DataFlowEditor() ) {
152 DataFlowEditor()->Graph()->SetObjImpl( objimpl ) ;
154 if ( DataFlowExecutor() ) {
155 DataFlowExecutor()->Graph()->SetObjImpl( objimpl ) ;
161 virtual void Coords( CORBA::Long X , CORBA::Long Y ) ;
162 virtual CORBA::Long X() ;
163 virtual CORBA::Long Y() ;
165 virtual SUPERV::Port_ptr Port( const char * aParameterName ) ;
167 // virtual bool BusPorts( const char * InputParameterName ,
168 // const char * InputParameterType ,
169 // const char * OutputParameterName ,
170 // const char * OutputParameterType ,
171 // SUPERV::Port_out InputPort ,
172 // SUPERV::Port_out OutputPort ) ;
174 // virtual SUPERV::Link_ptr Link( const char * ToServiceParameterName ,
175 // const SUPERV::Value_ptr aValue ) ;
177 virtual SUPERV::Port_ptr Input( const char * ToServiceParameterName ,
178 const SUPERV::Value_ptr aValue ) ;
179 // virtual bool InputOfAny( const char * ToServiceParameterName ,
180 // const CORBA::Any & aValue ) ;
182 virtual SUPERV::Port_ptr GetInPort( const char * aParameterName ) ;
183 virtual SUPERV::Port_ptr GetOutPort( const char * aParameterName ) ;
185 virtual SUPERV::StreamPort_ptr GetInStreamPort( const char * aParameterName ) ;
186 virtual SUPERV::StreamPort_ptr GetOutStreamPort( const char * aParameterName ) ;
188 virtual SUPERV::ListOfPorts * Ports() ;
189 virtual SUPERV::ListOfStreamPorts * StreamPorts() ;
191 virtual bool HasStreamPort() ;
193 virtual SUPERV::ListOfLinks * Links() ;
194 virtual SUPERV::ListOfStreamLinks * StreamLinks() ;
196 virtual SUPERV::Link_ptr GetLink( const char * ToServiceParameterName ) ;
197 virtual SUPERV::StreamLink_ptr GetStreamLink( const char * ToServiceParameterName ) ;
199 virtual bool IsStreamGraph() ;
200 virtual bool IsGraph() ;
201 virtual bool IsMacro() ;
202 virtual bool IsFlowMacro() ;
203 virtual bool IsStreamMacro() ;
204 virtual bool IsHeadGraph() ;
205 virtual CORBA::Long GraphLevel() ;
206 virtual bool IsComputing() ;
207 virtual bool IsFactory() ;
208 virtual bool IsInLine() ;
209 virtual bool IsGOTO() ;
210 virtual bool IsLoop() ;
211 virtual bool IsEndLoop() ;
212 virtual bool IsSwitch() ;
213 virtual bool IsEndSwitch() ;
215 virtual CORBA::Long SubGraph() ;
216 virtual CORBA::Long SubStreamGraph() ;
218 // mkr : PAL8060 : this method is not used
219 //virtual bool IsLinked(const char * ToServiceParameterName ) ;
220 virtual bool HasInput(const char * ToServiceParameterName ) ;
222 // virtual SUPERV::Link_ptr GetLink(const char * ToServiceParameterName ) ;
223 // virtual SUPERV::Value_ptr GetValue(const char * FromServiceParameterName ) ;
225 virtual bool IsReady() ;
226 virtual bool IsWaiting() ;
227 virtual bool IsRunning() ;
228 virtual bool IsDone() ;
229 virtual bool IsSuspended() ;
231 virtual SUPERV::GraphState State() ;
232 virtual SUPERV::ControlState Control() ;
233 virtual void ControlClear() ;
235 virtual CORBA::Long Thread() ;
237 GraphExecutor::AutomatonState AutoState() ;
239 virtual bool ReadyW() ;
240 virtual bool RunningW() ;
241 virtual bool DoneW() ;
242 virtual bool SuspendedW() ;
244 virtual void ping() ;
245 virtual bool ContainerKill() ;
247 virtual bool Kill() ;
248 virtual bool KillDone() ;
249 virtual bool Stop() ;
250 virtual bool Suspend() ;
251 virtual bool SuspendDone() ;
252 virtual bool Resume() ;
254 virtual CORBA::Long CpuUsed() ;
256 virtual CORBA::Boolean IsExecuting();