Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/superv.git] / src / Supervision / SNode_Impl.cxx
1 using namespace std;
2 //=============================================================================
3 // File      : SNode_Impl.cxx
4 // Created   : 2003
5 // Author    : Jean Rahuel
6 // Project   : SALOME
7 // $Header: 
8 //=============================================================================
9
10 #include <stdio.h>
11 #include <fstream>
12 #include <strstream>
13 #include <string>
14
15 #include "utilities.h"
16
17 #include "SNode_Impl.hxx"
18
19 SNode_Impl::SNode_Impl() {
20 }
21
22 SNode_Impl::SNode_Impl( CORBA::ORB_ptr orb ,
23                         PortableServer::POA_ptr poa ,
24                         PortableServer::ObjectId * contId , 
25                         const char *instanceName ,
26                         const char *interfaceName ,
27                         GraphEditor::DataFlow * aDataFlowEditor ,
28                         const char * FuncName , 
29                         const SUPERV::ListOfStrings & PythonFunction ,
30                         const SUPERV::KindOfNode NodeKindOfNode ) :
31 //  Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
32   GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , FuncName , PythonFunction , NodeKindOfNode ) {
33 //  MESSAGE( NodeName << " " );
34   beginService( "SNode_Impl::SNode_Impl" );
35   _thisObj = this ;
36   _id = _poa->activate_object(_thisObj);
37   _Orb = CORBA::ORB::_duplicate(orb);
38   _Poa = poa ;
39   _ContId = contId ;
40 //  DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
41 //                                           NodeInterfaceName , NodeName ,
42 //                                           NodeKindOfNode ) ) ;
43 //  DataFlowNode( DataFlowEditor()->AddNode( SALOME_ModuleCatalog::Service() ,
44 //                                           "" , "" , "" ,
45 //                                           NodeKindOfNode ) ) ;
46   endService( "SNode_Impl::SNode_Impl" );  
47 }
48
49 SNode_Impl::SNode_Impl( CORBA::ORB_ptr orb ,
50                       PortableServer::POA_ptr poa ,
51                       PortableServer::ObjectId * contId , 
52                       const char *instanceName ,
53                       const char *interfaceName ,
54                       GraphEditor::DataFlow * aDataFlowEditor ,
55                       GraphEditor::InNode * aDataFlowNode ) :
56 //  Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
57   GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
58   MESSAGE( DataFlowNode()->Name() << " " );
59   beginService( "SNode_Impl::SNode_Impl" );
60   _thisObj = this ;
61   _id = _poa->activate_object(_thisObj);
62   _Orb = CORBA::ORB::_duplicate(orb);
63   _Poa = poa ;
64   _ContId = contId ;
65   endService( "SNode_Impl::SNode_Impl" );  
66 }
67
68 SNode_Impl::~SNode_Impl() {
69   beginService( "SNode_Impl::~SNode_Impl" );
70   endService( "SNode_Impl::~SNode_Impl" );
71 }
72
73 void SNode_Impl::destroy() {
74   beginService( "SNode_Impl::Destroy" );
75   if ( DataFlowEditor()->IsEditing() ) {
76     if ( Delete() ) {
77       _poa->deactivate_object(*_id) ;
78       CORBA::release(_poa) ;
79       delete(_id) ;
80       _thisObj->_remove_ref();
81     }
82   }
83   endService( "SNode_Impl::Destroy" );
84 }
85
86 bool SNode_Impl::Delete() {
87 //  beginService( "SNode_Impl::Delete" );
88   bool RetVal = false ;
89   if ( DataFlowEditor()->IsEditing() ) {
90     RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
91     if ( RetVal )
92       RetVal = DataFlowEditor()->IsValid() ;
93   }
94 //  endService( "SNode_Impl::Delete" );
95   return RetVal ;
96 }
97