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 : ESNode_Impl.cxx
23 // Author : Jean Rahuel
32 //#include "utilities.h"
34 #include "ESNode_Impl.hxx"
36 ESNode_Impl::ESNode_Impl() {
39 ESNode_Impl::ESNode_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::KindOfNode NodeKindOfNode ) :
47 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
48 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , FuncName , SUPERV::ListOfStrings() , NodeKindOfNode ) {
49 // MESSAGE( NodeName << " " );
50 beginService( "ESNode_Impl::ESNode_Impl" );
52 // cout << "ESNode_Impl::GNode_Impl " << (void *) FuncName << " " << FuncName
53 // << " " << strlen( FuncName ) << endl ;
56 _id = _poa->activate_object(_thisObj);
57 _Orb = CORBA::ORB::_duplicate(orb);
60 // DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
61 // NodeInterfaceName , NodeName ,
62 // NodeKindOfNode ) ) ;
63 // DataFlowNode( DataFlowEditor()->AddNode( SALOME_ModuleCatalog::Service() ,
65 // NodeKindOfNode ) ) ;
66 endService( "ESNode_Impl::ESNode_Impl" );
69 ESNode_Impl::ESNode_Impl( CORBA::ORB_ptr orb ,
70 PortableServer::POA_ptr poa ,
71 PortableServer::ObjectId * contId ,
72 const char *instanceName ,
73 const char *interfaceName ,
74 GraphEditor::DataFlow * aDataFlowEditor ,
75 GraphEditor::InNode * aDataFlowNode ) :
76 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
77 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
78 MESSAGE( DataFlowNode()->Name() << " " );
79 beginService( "ESNode_Impl::ESNode_Impl" );
81 _id = _poa->activate_object(_thisObj);
82 _Orb = CORBA::ORB::_duplicate(orb);
85 endService( "ESNode_Impl::ESNode_Impl" );
88 ESNode_Impl::~ESNode_Impl() {
89 beginService( "ESNode_Impl::~ESNode_Impl" );
90 endService( "ESNode_Impl::~ESNode_Impl" );
93 void ESNode_Impl::destroy() {
94 beginService( "ESNode_Impl::Destroy" );
95 if ( DataFlowEditor()->IsEditing() ) {
96 // SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
98 _poa->deactivate_object(*_id) ;
99 // CORBA::release(_poa) ;
101 // _thisObj->_remove_ref();
104 MESSAGE("ESNode_Impl::destroy ERROR ") ;
106 // destroy have to be used for the SwitchNode ==> destroy of the EndSwitchNode
107 // if ( !CORBA::is_nil( aCoupled ) ) {
108 // aCoupled->SetCoupled( "" ) ;
109 // aCoupled->destroy() ;
112 endService( "ESNode_Impl::Destroy" );
115 bool ESNode_Impl::Delete() {
116 beginService( "ESNode_Impl::Delete" );
117 bool RetVal = false ;
118 if ( DataFlowEditor()->IsEditing() ) {
120 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
121 // IsValid is done in SNode_Impl::Delete
123 // RetVal = DataFlowEditor()->IsValid() ;
126 endService( "ESNode_Impl::Delete" );