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_
15 //#include <iostream.h>
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 const char *aDataFlowName ,
45 const SUPERV::KindOfNode aKindOfNode ) ;
46 GNode_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 char * FuncName ,
53 const SUPERV::ListOfStrings & PythonFunction ,
54 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::GOTONode ) ;
55 GNode_Impl( CORBA::ORB_ptr orb ,
56 PortableServer::POA_ptr poa ,
57 PortableServer::ObjectId * contId ,
58 const char *instanceName ,
59 const char *interfaceName ,
60 GraphEditor::DataFlow * DataFlowEditor ,
61 GraphBase::ListOfFuncName FuncNameList ,
62 GraphBase::ListOfPythonFunctions PythonFunctionList ,
63 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::GOTONode ) ;
64 GNode_Impl( CORBA::ORB_ptr orb ,
65 PortableServer::POA_ptr poa ,
66 PortableServer::ObjectId * contId ,
67 const char *instanceName ,
68 const char *interfaceName ,
69 GraphEditor::DataFlow * DataFlowEditor ,
70 GraphEditor::InNode * DataFlowNode ) ;
71 GNode_Impl( CORBA::ORB_ptr orb ,
72 PortableServer::POA_ptr poa ,
73 PortableServer::ObjectId * contId ,
74 const char *instanceName ,
75 const char *interfaceName ,
76 GraphExecutor::DataFlow * DataFlowExecutor ,
77 GraphExecutor::InNode * DataFlowExecutorNode ) ;
78 virtual ~GNode_Impl() ;
79 virtual void destroy() ;
80 virtual bool Delete() ;
82 virtual bool SetCoupled( const char * anInLineNode ) {
83 GraphBase::InLineNode * CoupledINode = (GraphBase::InLineNode * ) DataFlowEditor()->Graph()->GetGraphNode( anInLineNode ) ;
84 // cout << Name() << ".SetCoupled " << anInLineNode << endl ;
85 // if ( CoupledINode && ( IsGOTO() &&
87 ( CoupledINode->IsInLineNode() || CoupledINode->IsLoopNode() ||
88 CoupledINode->IsSwitchNode() ) ) ||
89 ( !IsGOTO() && ( IsLoop() || IsSwitch() ||
90 IsEndLoop() || IsEndSwitch() ) ) ) {
91 DataFlowNode()->CoupledNode( CoupledINode ) ;
92 if ( CoupledINode && IsSwitch() ) {
93 DataFlowEditor()->AddLink( Name() , "Default" ,
94 CoupledINode->Name() , "Default" ) ;
96 else if ( CoupledINode && ( IsLoop() || IsEndLoop() ) ) {
97 DataFlowEditor()->AddLink( Name() , "DoLoop" ,
98 CoupledINode->Name() , "DoLoop" ) ;
100 else if ( CoupledINode && IsGOTO() ) {
101 DataFlowEditor()->AddLink( Name() , "OutGate" ,
102 CoupledINode->Name() , "InGate" ) ;
104 // cout << "SetCoupled " << CoupledINode->Name() << endl ;
107 // cout << Name() << ".SetCoupled ERROR " << anInLineNode << " " << CoupledINode
108 // << " of " << Kind() ;
109 // if ( CoupledINode ) {
110 // cout << " kinfOkCoupled " << CoupledINode->Kind() ;
114 virtual SUPERV::INode_ptr Coupled() ;
116 virtual GraphBase::GOTONode * BaseNode() {
117 return DataFlowNode()->GOTONode() ; } ;