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 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() &&
73 ( CoupledINode->IsInLineNode() || CoupledINode->IsLoopNode() ||
74 CoupledINode->IsSwitchNode() ) ) ||
75 ( !IsGOTO() && ( IsLoop() || IsSwitch() ||
76 IsEndLoop() || IsEndSwitch() ) ) ) {
77 DataFlowNode()->CoupledNode( CoupledINode ) ;
78 if ( CoupledINode && IsSwitch() ) {
79 DataFlowEditor()->AddLink( Name() , "Default" ,
80 CoupledINode->Name() , "Default" ) ;
82 else if ( CoupledINode && ( IsLoop() || IsEndLoop() ) ) {
83 DataFlowEditor()->AddLink( Name() , "DoLoop" ,
84 CoupledINode->Name() , "DoLoop" ) ;
86 else if ( CoupledINode && IsGOTO() ) {
87 DataFlowEditor()->AddLink( Name() , "OutGate" ,
88 CoupledINode->Name() , "InGate" ) ;
90 // cout << "SetCoupled " << CoupledINode->Name() << endl ;
93 // cout << Name() << ".SetCoupled ERROR " << anInLineNode << " " << CoupledINode
94 // << " of " << Kind() ;
95 // if ( CoupledINode ) {
96 // cout << " kinfOkCoupled " << CoupledINode->Kind() ;
100 virtual SUPERV::INode_ptr Coupled() ;
102 virtual GraphBase::GOTONode * BaseNode() {
103 return DataFlowNode()->GOTONode() ; } ;