1 // SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SNode_Impl.cxx
23 // Author : Jean Rahuel
32 //#include "utilities.h"
34 #include "SNode_Impl.hxx"
36 SNode_Impl::SNode_Impl() {
39 SNode_Impl::SNode_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 * aDataFlowEditor ,
45 const char * FuncName ,
46 const SUPERV::ListOfStrings & PythonFunction ,
47 const SUPERV::KindOfNode NodeKindOfNode ) :
48 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
49 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , FuncName , PythonFunction , NodeKindOfNode ) {
50 // MESSAGE( NodeName << " " );
51 beginService( "SNode_Impl::SNode_Impl" );
53 _id = _poa->activate_object(_thisObj);
54 _Orb = CORBA::ORB::_duplicate(orb);
57 // DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
58 // NodeInterfaceName , NodeName ,
59 // NodeKindOfNode ) ) ;
60 // DataFlowNode( DataFlowEditor()->AddNode( SALOME_ModuleCatalog::Service() ,
62 // NodeKindOfNode ) ) ;
63 endService( "SNode_Impl::SNode_Impl" );
66 SNode_Impl::SNode_Impl( CORBA::ORB_ptr orb ,
67 PortableServer::POA_ptr poa ,
68 PortableServer::ObjectId * contId ,
69 const char *instanceName ,
70 const char *interfaceName ,
71 GraphEditor::DataFlow * aDataFlowEditor ,
72 GraphEditor::InNode * aDataFlowNode ) :
73 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
74 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
75 MESSAGE( DataFlowNode()->Name() << " " );
76 beginService( "SNode_Impl::SNode_Impl" );
78 _id = _poa->activate_object(_thisObj);
79 _Orb = CORBA::ORB::_duplicate(orb);
82 endService( "SNode_Impl::SNode_Impl" );
85 SNode_Impl::~SNode_Impl() {
86 beginService( "SNode_Impl::~SNode_Impl" );
87 endService( "SNode_Impl::~SNode_Impl" );
90 void SNode_Impl::destroy() {
91 beginService( "SNode_Impl::Destroy" );
92 if ( DataFlowEditor()->IsEditing() ) {
93 SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
95 _poa->deactivate_object(*_id) ;
96 // CORBA::release(_poa) ;
98 // _thisObj->_remove_ref();
101 MESSAGE("SNode_Impl::destroy ERROR ") ;
103 if ( !CORBA::is_nil( aCoupled ) ) {
104 // aCoupled->SetCoupled( "" ) ; : Used in GraphBase::Graph::RemoveNode( EndSwitchNode ) :
105 aCoupled->destroy() ;
107 // Valid() only after deletion of the corresponding EndSwitchNode :
108 DataFlowEditor()->UnValid() ;
110 endService( "SNode_Impl::Destroy" );
113 bool SNode_Impl::Delete() {
114 beginService( "SNode_Impl::Delete" );
115 bool RetVal = false ;
116 if ( DataFlowEditor()->IsEditing() ) {
118 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
119 // Valid() only after deletion of the corresponding EndLoopNode :
121 // RetVal = DataFlowEditor()->IsValid() ;
124 endService( "SNode_Impl::Delete" );