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 : FNode_Impl.cxx
23 // Author : Jean Rahuel
32 //#include "utilities.h"
34 #include "FNode_Impl.hxx"
36 FNode_Impl::FNode_Impl() {
39 FNode_Impl::FNode_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 SALOME_ModuleCatalog::Service &NodeService ,
46 const char * NodeComponentName ,
47 const char * NodeInterfaceName ,
48 const char * NodeName ,
49 const SUPERV::KindOfNode NodeKindOfNode ,
51 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
52 CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , NodeService , NodeName , NodeKindOfNode , NULLSTRING , SUPERV::ListOfStrings() , isCimpl ) {
53 // MESSAGE( NodeName << " " );
54 beginService( "FNode_Impl::FNode_Impl" );
55 // cout << "FNode_Impl::FNode_Impl -->" << endl ;
57 _id = _poa->activate_object(_thisObj);
58 _Orb = CORBA::ORB::_duplicate(orb);
62 // DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
63 // NodeInterfaceName , NodeName ,
64 // NodeKindOfNode ) ) ;
65 DataFlowNode()->ComponentName( NodeComponentName ) ;
66 DataFlowNode()->InterfaceName( NodeInterfaceName ) ;
67 endService( "FNode_Impl::FNode_Impl" );
68 // cout << "<-- FNode_Impl::FNode_Impl" << endl ;
71 FNode_Impl::FNode_Impl( CORBA::ORB_ptr orb ,
72 PortableServer::POA_ptr poa ,
73 PortableServer::ObjectId * contId ,
74 const char * instanceName ,
75 const char * interfaceName ,
76 GraphEditor::DataFlow * aDataFlowEditor ,
77 GraphEditor::InNode * aDataFlowNode ) :
78 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
79 CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
80 MESSAGE( DataFlowNode()->Name() << " " );
81 beginService( "FNode_Impl::FNode_Impl" );
83 _id = _poa->activate_object(_thisObj);
84 _Orb = CORBA::ORB::_duplicate(orb);
88 endService( "FNode_Impl::FNode_Impl" );
91 FNode_Impl::~FNode_Impl() {
92 beginService( "FNode_Impl::~Node_Impl" );
93 endService( "FNode_Impl::~Node_Impl" );
96 void FNode_Impl::destroy() {
97 beginService( "FNode_Impl::Destroy" );
98 if ( DataFlowEditor()->IsEditing() ) {
100 _poa->deactivate_object(*_id) ;
101 // CORBA::release(_poa) ;
103 // _thisObj->_remove_ref();
106 MESSAGE("FNode_Impl::destroy ERROR ") ;
109 // endService( "FNode_Impl::Destroy" );
112 bool FNode_Impl::Delete() {
113 // beginService( "FNode_Impl::Delete" );
114 bool RetVal = false ;
115 if ( DataFlowEditor()->IsEditing() ) {
117 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
119 DataFlowEditor()->UnValid() ;
122 // endService( "FNode_Impl::Delete" );
126 char * FNode_Impl::GetComponentName() {
127 // beginService( "FNode_Impl::GetComponentName" );
128 char * RetVal = DataFlowNode()->ComponentName() ;
129 // endService( "FNode_Impl::GetComponentName" );
130 return CORBA::string_dup( RetVal );
132 bool FNode_Impl::SetComponentName( const char * aComponentName ) {
133 // beginService( "FNode_Impl::SetComponentName" );
134 bool RetVal = false ;
135 RetVal = DataFlowNode()->ComponentName( aComponentName ) ;
136 // endService( "FNode_Impl::SetComponentName" );
139 char * FNode_Impl::GetInterfaceName() {
140 // beginService( "FNode_Impl::GetInterfaceName" );
141 char * RetVal = DataFlowNode()->InterfaceName() ;
142 // endService( "FNode_Impl::GetInterfaceName" );
143 return CORBA::string_dup( RetVal );
145 bool FNode_Impl::SetInterfaceName( const char * anInterfaceName ) {
146 // beginService( "FNode_Impl::SetInterfaceName" );
147 bool RetVal = false ;
148 RetVal = DataFlowNode()->InterfaceName( anInterfaceName ) ;
149 // endService( "FNode_Impl::SetInterfaceName" );
152 char * FNode_Impl::GetContainer() {
153 // beginService( "FNode_Impl::GetContainer" );
154 char * RetVal = DataFlowNode()->Computer() ;
155 // endService( "FNode_Impl::GetContainer" );
156 return CORBA::string_dup( RetVal ) ;
158 bool FNode_Impl::SetContainer( const char * aDataFlowContainer ) {
159 // beginService( "FNode_Impl::SetContainer" );
160 bool RetVal = false ;
161 // GraphExecutor::DataFlow * _DataFlowExecutor = DataFlowEditor()->Executor() ;
162 // if ( DataFlowEditor()->IsEditing() ) {
163 RetVal = DataFlowNode()->Computer( aDataFlowContainer ) ;
165 // else if ( _DataFlowExecutor && ( _DataFlowExecutor->IsSuspended() ||
166 // _DataFlowExecutor->IsSuspended( DataFlowNode()->Name() ) ) ) {
167 // if ( _DataFlowExecutor->Graph()->GetChangeGraphNode( DataFlowNode()->Name() ) ) {
168 // RetVal = ((GraphEditor::InNode * ) _DataFlowExecutor->Graph()->GetChangeGraphNode( DataFlowNode()->Name() )->GetInNode())->Computer( aDataFlowContainer ) ;
169 DataFlowEditor()->UnValid() ;
172 // endService( "FNode_Impl::SetContainer" );