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 : SNode_Impl.cxx
8 // Author : Jean Rahuel
18 //#include "utilities.h"
20 #include "SNode_Impl.hxx"
22 SNode_Impl::SNode_Impl() {
25 SNode_Impl::SNode_Impl( CORBA::ORB_ptr orb ,
26 PortableServer::POA_ptr poa ,
27 PortableServer::ObjectId * contId ,
28 const char *instanceName ,
29 const char *interfaceName ,
30 GraphEditor::DataFlow * aDataFlowEditor ,
31 const char * FuncName ,
32 const SUPERV::ListOfStrings & PythonFunction ,
33 const SUPERV::KindOfNode NodeKindOfNode ) :
34 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
35 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , FuncName , PythonFunction , NodeKindOfNode ) {
36 // MESSAGE( NodeName << " " );
37 beginService( "SNode_Impl::SNode_Impl" );
39 _id = _poa->activate_object(_thisObj);
40 _Orb = CORBA::ORB::_duplicate(orb);
43 // DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
44 // NodeInterfaceName , NodeName ,
45 // NodeKindOfNode ) ) ;
46 // DataFlowNode( DataFlowEditor()->AddNode( SALOME_ModuleCatalog::Service() ,
48 // NodeKindOfNode ) ) ;
49 endService( "SNode_Impl::SNode_Impl" );
52 SNode_Impl::SNode_Impl( CORBA::ORB_ptr orb ,
53 PortableServer::POA_ptr poa ,
54 PortableServer::ObjectId * contId ,
55 const char *instanceName ,
56 const char *interfaceName ,
57 GraphEditor::DataFlow * aDataFlowEditor ,
58 GraphEditor::InNode * aDataFlowNode ) :
59 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
60 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
61 MESSAGE( DataFlowNode()->Name() << " " );
62 beginService( "SNode_Impl::SNode_Impl" );
64 _id = _poa->activate_object(_thisObj);
65 _Orb = CORBA::ORB::_duplicate(orb);
68 endService( "SNode_Impl::SNode_Impl" );
71 SNode_Impl::~SNode_Impl() {
72 beginService( "SNode_Impl::~SNode_Impl" );
73 endService( "SNode_Impl::~SNode_Impl" );
76 void SNode_Impl::destroy() {
77 beginService( "SNode_Impl::Destroy" );
78 if ( DataFlowEditor()->IsEditing() ) {
79 SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
81 _poa->deactivate_object(*_id) ;
82 CORBA::release(_poa) ;
84 _thisObj->_remove_ref();
87 MESSAGE("SNode_Impl::destroy ERROR ") ;
89 if ( !CORBA::is_nil( aCoupled ) ) {
90 // aCoupled->SetCoupled( "" ) ; : Used in GraphBase::Graph::RemoveNode( EndSwitchNode ) :
93 // Valid() only after deletion of the corresponding EndSwitchNode :
94 DataFlowEditor()->UnValid() ;
96 endService( "SNode_Impl::Destroy" );
99 bool SNode_Impl::Delete() {
100 beginService( "SNode_Impl::Delete" );
101 bool RetVal = false ;
102 if ( DataFlowEditor()->IsEditing() ) {
104 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
105 // Valid() only after deletion of the corresponding EndLoopNode :
107 // RetVal = DataFlowEditor()->IsValid() ;
110 endService( "SNode_Impl::Delete" );