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 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() ;
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 ; } ;
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 ) ;
100 virtual GraphEditor::InNode * DataFlowNode() const {
101 return _DataFlowNode ; } ;
102 virtual GraphBase::ComputingNode * BaseNode() {
103 return _DataFlowNode->ComputingNode() ; } ;
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() ) ;
111 iobject = SUPERV::CNode::_narrow( _DataFlowEditor->Graph()->ObjRef() ) ;
114 virtual void SetObjRef(SUPERV::CNode_var aNode ) {
115 if ( _DataFlowNode && _IsNode ) {
116 _DataFlowNode->SetObjRef( aNode ) ;
119 _DataFlowEditor->Graph()->SetObjRef( SUPERV::Graph::_narrow( aNode ) ) ;
123 virtual void Coords( const long X , const long Y ) ;
127 virtual SUPERV::Port_ptr Port( const char * aParameterName ) ;
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 ) ;
136 // virtual SUPERV::Link_ptr Link( const char * ToServiceParameterName ,
137 // const SUPERV::Value_ptr aValue ) ;
139 virtual SUPERV::Port_ptr Input( const char * ToServiceParameterName ,
140 const SUPERV::Value_ptr aValue ) ;
142 virtual SUPERV::Port_ptr GetInPort( const char * aParameterName ) ;
143 virtual SUPERV::Port_ptr GetOutPort( const char * aParameterName ) ;
145 virtual SUPERV::StreamPort_ptr GetInStreamPort( const char * aParameterName ) ;
146 virtual SUPERV::StreamPort_ptr GetOutStreamPort( const char * aParameterName ) ;
148 virtual SUPERV::ListOfPorts * Ports() ;
149 virtual SUPERV::ListOfStreamPorts * StreamPorts() ;
151 virtual SUPERV::ListOfLinks * Links() ;
152 virtual SUPERV::ListOfStreamLinks * StreamLinks() ;
154 virtual SUPERV::Link_ptr GetLink( const char * ToServiceParameterName ) ;
155 virtual SUPERV::StreamLink_ptr GetStreamLink( const char * ToServiceParameterName ) ;
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() ;
168 virtual long SubGraph() ;
169 virtual long SubStreamGraph() ;
171 virtual bool IsLinked(const char * ToServiceParameterName ) ;
172 virtual bool HasInput(const char * ToServiceParameterName ) ;
174 // virtual SUPERV::Link_ptr GetLink(const char * ToServiceParameterName ) ;
175 // virtual SUPERV::Value_ptr GetValue(const char * FromServiceParameterName ) ;
177 virtual bool IsReady() ;
178 virtual bool IsWaiting() ;
179 virtual bool IsRunning() ;
180 virtual bool IsDone() ;
181 virtual bool IsSuspended() ;
183 virtual SUPERV::GraphState State() ;
184 virtual SUPERV::ControlState Control() ;
185 virtual void ControlClear() ;
187 virtual long Thread() ;
189 virtual SUPERV::AutomatonState AutoState() ;
191 virtual bool ReadyW() ;
192 virtual bool RunningW() ;
193 virtual bool DoneW() ;
194 virtual bool SuspendedW() ;
196 virtual void ping() ;
197 virtual bool ContainerKill() ;
199 virtual bool Kill() ;
200 virtual bool KillDone() ;
201 virtual bool Stop() ;
202 virtual bool Suspend() ;
203 virtual bool SuspendDone() ;
204 virtual bool Resume() ;
207 virtual bool ReRun() ;
208 virtual bool ReRunAt( const char * aNodeName ) ;
209 virtual bool ReStart() ;
210 virtual bool ReStartAt( const char * aNodeName ) ;
212 virtual long CpuUsed() ;