1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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 // SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
23 // File : ESNode_Impl.cxx
24 // Author : Jean Rahuel
33 //#include "utilities.h"
35 #include "ESNode_Impl.hxx"
37 ESNode_Impl::ESNode_Impl() {
40 ESNode_Impl::ESNode_Impl( CORBA::ORB_ptr orb ,
41 PortableServer::POA_ptr poa ,
42 PortableServer::ObjectId * contId ,
43 const char *instanceName ,
44 const char *interfaceName ,
45 GraphEditor::DataFlow * aDataFlowEditor ,
46 const char * FuncName ,
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 , SUPERV::ListOfStrings() , NodeKindOfNode ) {
50 // MESSAGE( NodeName << " " );
51 beginService( "ESNode_Impl::ESNode_Impl" );
53 // cout << "ESNode_Impl::GNode_Impl " << (void *) FuncName << " " << FuncName
54 // << " " << strlen( FuncName ) << endl ;
57 _id = _poa->activate_object(_thisObj);
58 _Orb = CORBA::ORB::_duplicate(orb);
61 // DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
62 // NodeInterfaceName , NodeName ,
63 // NodeKindOfNode ) ) ;
64 // DataFlowNode( DataFlowEditor()->AddNode( SALOME_ModuleCatalog::Service() ,
66 // NodeKindOfNode ) ) ;
67 endService( "ESNode_Impl::ESNode_Impl" );
70 ESNode_Impl::ESNode_Impl( CORBA::ORB_ptr orb ,
71 PortableServer::POA_ptr poa ,
72 PortableServer::ObjectId * contId ,
73 const char *instanceName ,
74 const char *interfaceName ,
75 GraphEditor::DataFlow * aDataFlowEditor ,
76 GraphEditor::InNode * aDataFlowNode ) :
77 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
78 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
79 MESSAGE( DataFlowNode()->Name() << " " );
80 beginService( "ESNode_Impl::ESNode_Impl" );
82 _id = _poa->activate_object(_thisObj);
83 _Orb = CORBA::ORB::_duplicate(orb);
86 endService( "ESNode_Impl::ESNode_Impl" );
89 ESNode_Impl::~ESNode_Impl() {
90 beginService( "ESNode_Impl::~ESNode_Impl" );
91 endService( "ESNode_Impl::~ESNode_Impl" );
94 void ESNode_Impl::destroy() {
95 beginService( "ESNode_Impl::Destroy" );
96 if ( DataFlowEditor()->IsEditing() ) {
97 // SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
99 _poa->deactivate_object(*_id) ;
100 // CORBA::release(_poa) ;
102 // _thisObj->_remove_ref();
105 MESSAGE("ESNode_Impl::destroy ERROR ") ;
107 // destroy have to be used for the SwitchNode ==> destroy of the EndSwitchNode
108 // if ( !CORBA::is_nil( aCoupled ) ) {
109 // aCoupled->SetCoupled( "" ) ;
110 // aCoupled->destroy() ;
113 endService( "ESNode_Impl::Destroy" );
116 bool ESNode_Impl::Delete() {
117 beginService( "ESNode_Impl::Delete" );
118 bool RetVal = false ;
119 if ( DataFlowEditor()->IsEditing() ) {
121 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
122 // IsValid is done in SNode_Impl::Delete
124 // RetVal = DataFlowEditor()->IsValid() ;
127 endService( "ESNode_Impl::Delete" );