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->ObjRef() ) ;
114 virtual void SetObjRef(SUPERV::CNode_var aNode ) {
115 if ( _DataFlowNode && _IsNode ) {
116 _DataFlowNode->SetObjRef( aNode ) ;
119 _DataFlowEditor->SetObjRef( SUPERV::Graph::_narrow( aNode ) ) ;
122 virtual void Coords( const long X , const long Y ) ;
126 virtual SUPERV::Port_ptr Port( const char * aParameterName ) ;
128 // virtual bool BusPorts( const char * InputParameterName ,
129 // const char * InputParameterType ,
130 // const char * OutputParameterName ,
131 // const char * OutputParameterType ,
132 // SUPERV::Port_out InputPort ,
133 // SUPERV::Port_out OutputPort ) ;
135 // virtual SUPERV::Link_ptr Link( const char * ToServiceParameterName ,
136 // const SUPERV::Value_ptr aValue ) ;
138 virtual SUPERV::Port_ptr Input( const char * ToServiceParameterName ,
139 const SUPERV::Value_ptr aValue ) ;
141 virtual SUPERV::ListOfPorts * Ports() ;
143 virtual SUPERV::ListOfLinks * Links() ;
145 virtual SUPERV::Link_ptr GetLink( const char * ToServiceParameterName ) ;
147 virtual bool IsGraph() ;
148 virtual bool IsComputing() ;
149 virtual bool IsFactory() ;
150 virtual bool IsInLine() ;
151 virtual bool IsGOTO() ;
152 virtual bool IsLoop() ;
153 virtual bool IsEndLoop() ;
154 virtual bool IsSwitch() ;
155 virtual bool IsEndSwitch() ;
157 virtual long SubGraph() ;
159 virtual bool IsLinked(const char * ToServiceParameterName ) ;
160 virtual bool HasInput(const char * ToServiceParameterName ) ;
162 // virtual SUPERV::Link_ptr GetLink(const char * ToServiceParameterName ) ;
163 // virtual SUPERV::Value_ptr GetValue(const char * FromServiceParameterName ) ;
165 virtual bool IsReady() ;
166 virtual bool IsWaiting() ;
167 virtual bool IsRunning() ;
168 virtual bool IsDone() ;
169 virtual bool IsSuspended() ;
171 virtual SUPERV::GraphState State() ;
172 virtual SUPERV::ControlState Control() ;
173 virtual void ControlClear() ;
175 virtual long Thread() ;
177 virtual SUPERV::AutomatonState AutoState() ;
179 virtual bool ReadyW() ;
180 virtual bool RunningW() ;
181 virtual bool DoneW() ;
182 virtual bool SuspendedW() ;
184 virtual void ping() ;
185 virtual bool ContainerKill() ;
187 virtual bool Kill() ;
188 virtual bool KillDone() ;
189 virtual bool Stop() ;
190 virtual bool Suspend() ;
191 virtual bool SuspendDone() ;
192 virtual bool Resume() ;
195 virtual bool ReRun() ;
196 virtual bool ReRunAt( const char * aNodeName ) ;
197 virtual bool ReStart() ;
198 virtual bool ReStartAt( const char * aNodeName ) ;
200 virtual long CpuUsed() ;