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 : GNode_Impl.hxx
8 // Author : Jean Rahuel
12 #ifndef _GNODE_IMPL_HXX_
13 #define _GNODE_IMPL_HXX_
19 #include <SALOMEconfig.h>
20 #include "SALOME_Component_i.hxx"
21 #include "SALOME_LifeCycleCORBA.hxx"
23 #include "INode_Impl.hxx"
24 #include "Port_Impl.hxx"
26 #include "DataFlowEditor_DataFlow.hxx"
27 #include "DataFlowExecutor_DataFlow.hxx"
29 class GNode_Impl : public INode_Impl ,
30 public POA_SUPERV::GNode {
34 PortableServer::POA_ptr _Poa ;
35 PortableServer::ObjectId * _ContId ;
39 GNode_Impl( CORBA::ORB_ptr orb ,
40 PortableServer::POA_ptr poa ,
41 PortableServer::ObjectId * contId ,
42 const char *instanceName ,
43 const char *interfaceName ,
44 GraphEditor::DataFlow * DataFlowEditor ,
45 const char * FuncName ,
46 const SUPERV::ListOfStrings & PythonFunction ,
47 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::GOTONode ) ;
48 GNode_Impl( CORBA::ORB_ptr orb ,
49 PortableServer::POA_ptr poa ,
50 PortableServer::ObjectId * contId ,
51 const char *instanceName ,
52 const char *interfaceName ,
53 GraphEditor::DataFlow * DataFlowEditor ,
54 GraphBase::ListOfFuncName FuncNameList ,
55 GraphBase::ListOfPythonFunctions PythonFunctionList ,
56 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::GOTONode ) ;
57 GNode_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 GraphEditor::InNode * DataFlowNode ) ;
64 virtual ~GNode_Impl() ;
65 virtual void destroy() ;
66 virtual bool Delete() ;
68 virtual bool SetCoupled( const char * anInLineNode ) {
69 GraphBase::InLineNode * CoupledINode = (GraphBase::InLineNode * ) DataFlowEditor()->GetGraphNode( anInLineNode ) ;
70 cout << Name() << ".SetCoupled " << anInLineNode << endl ;
71 if ( CoupledINode && ( IsGOTO() &&
72 ( CoupledINode->IsInLineNode() || CoupledINode->IsLoopNode() ||
73 CoupledINode->IsSwitchNode() ) ) ||
74 ( !IsGOTO() && ( IsLoop() || IsSwitch() ||
75 IsEndLoop() || IsEndSwitch() ) ) ) {
76 DataFlowNode()->CoupledNode( CoupledINode ) ;
78 DataFlowEditor()->AddLink( Name() , "Default" ,
79 CoupledINode->Name() , "Default" ) ;
81 else if ( IsLoop() || IsEndLoop() ) {
82 DataFlowEditor()->AddLink( Name() , "DoLoop" ,
83 CoupledINode->Name() , "DoLoop" ) ;
85 else if ( IsGOTO() ) {
86 DataFlowEditor()->AddLink( Name() , "OutGate" ,
87 CoupledINode->Name() , "InGate" ) ;
89 cout << "SetCoupled " << CoupledINode->Name() << endl ;
92 cout << Name() << ".SetCoupled ERROR " << anInLineNode << " " << CoupledINode
95 cout << " kinfOkCoupled " << CoupledINode->Kind() ;
99 virtual SUPERV::INode_ptr Coupled() ;
101 virtual GraphBase::GOTONode * BaseNode() {
102 return DataFlowNode()->GOTONode() ; } ;