]> SALOME platform Git repositories - modules/superv.git/blob - src/Supervision/LNode_Impl.cxx
Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/superv.git] / src / Supervision / LNode_Impl.cxx
1 using namespace std;
2 //=============================================================================
3 // File      : LNode_Impl.cxx
4 // Created   : Nov 2001
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 "LNode_Impl.hxx"
18
19 LNode_Impl::LNode_Impl() {
20 }
21
22 LNode_Impl::LNode_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                         GraphBase::ListOfFuncName FuncNameList ,
29                         GraphBase::ListOfPythonFunctions PythonFunctionList ,
30 //                        const char * InitName , 
31 //                        const SUPERV::ListOfStrings & anInitPythonFunction ,
32 //                        const char * MoreName , 
33 //                        const SUPERV::ListOfStrings & aMorePythonFunction ,
34 //                        const char * NextName , 
35 //                        const SUPERV::ListOfStrings & aNextPythonFunction ,
36                         const SUPERV::KindOfNode NodeKindOfNode ) :
37 //  Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
38 //  GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , InitName , anInitPythonFunction , NodeKindOfNode ) {
39   GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , FuncNameList , PythonFunctionList , NodeKindOfNode ) {
40 //  MESSAGE( NodeName << " " );
41   beginService( "LNode_Impl::LNode_Impl" );
42   _thisObj = this ;
43   _id = _poa->activate_object(_thisObj);
44   _Orb = CORBA::ORB::_duplicate(orb);
45   _Poa = poa ;
46   _ContId = contId ;
47 //  DataFlowNode()->SetPyMorePythonFunction( MoreName , aMorePythonFunction ) ;
48 //  DataFlowNode()->SetPyNextPythonFunction( NextName , aNextPythonFunction ) ;
49   endService( "LNode_Impl::LNode_Impl" );  
50 }
51
52 LNode_Impl::LNode_Impl( CORBA::ORB_ptr orb ,
53                       PortableServer::POA_ptr poa ,
54                       PortableServer::ObjectId * contId , 
55                       const char *instanceName ,
56                       const char *interfaceName ,
57                       GraphEditor::DataFlow * aDataFlowEditor ,
58                       GraphEditor::InNode * aDataFlowNode ) :
59 //  Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
60   GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
61   MESSAGE( DataFlowNode()->Name() << " " );
62   beginService( "LNode_Impl::LNode_Impl" );
63   _thisObj = this ;
64   _id = _poa->activate_object(_thisObj);
65   _Orb = CORBA::ORB::_duplicate(orb);
66   _Poa = poa ;
67   _ContId = contId ;
68   endService( "LNode_Impl::LNode_Impl" );  
69 }
70
71 LNode_Impl::~LNode_Impl() {
72   beginService( "LNode_Impl::~LNode_Impl" );
73   endService( "LNode_Impl::~LNode_Impl" );
74 }
75
76 void LNode_Impl::destroy() {
77   beginService( "LNode_Impl::Destroy" );
78   if ( DataFlowEditor()->IsEditing() ) {
79     if ( Delete() ) {
80       _poa->deactivate_object(*_id) ;
81       CORBA::release(_poa) ;
82       delete(_id) ;
83       _thisObj->_remove_ref();
84     }
85   }
86   endService( "LNode_Impl::Destroy" );
87 }
88
89 bool LNode_Impl::Delete() {
90 //  beginService( "LNode_Impl::Delete" );
91   bool RetVal = false ;
92   if ( DataFlowEditor()->IsEditing() ) {
93     RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
94     if ( RetVal )
95       RetVal = DataFlowEditor()->IsValid() ;
96   }
97 //  endService( "LNode_Impl::Delete" );
98   return RetVal ;
99 }
100
101 void LNode_Impl::SetPyInit( const char * InitName ,
102                             const SUPERV::ListOfStrings & aPyInit ) {
103   beginService( "LNode_Impl::SetPyInit" );
104   SetPyFunction( InitName , aPyInit ) ;
105   endService( "LNode_Impl::SetPyInit" );
106   return ;
107 }
108
109 SUPERV::ListOfStrings * LNode_Impl::PyInit() {
110   SUPERV::ListOfStrings * aPythonFunction ;
111   beginService( "LNode_Impl::PyInit" );
112   aPythonFunction = PyFunction() ;
113   endService( "LNode_Impl::PyInit" );
114   return aPythonFunction ;
115 }
116
117 char * LNode_Impl::PyInitName() {
118   beginService( "LNode_Impl::PyInitName" );
119   char * RetVal = PyFuncName() ;
120   endService( "LNode_Impl::PyInitName" );
121   return CORBA::string_dup( RetVal ) ;
122 }
123
124 void LNode_Impl::SetPyMore( const char * MoreName ,
125                             const SUPERV::ListOfStrings & aPyMore ) {
126   beginService( "LNode_Impl::SetPyMore" );
127   DataFlowNode()->SetPyMorePythonFunction( MoreName , aPyMore ) ;
128   endService( "LNode_Impl::SetPyMore" );
129   return ;
130 }
131
132 SUPERV::ListOfStrings * LNode_Impl::PyMore() {
133   SUPERV::ListOfStrings * aPythonFunction ;
134   beginService( "LNode_Impl::PyMore" );
135   aPythonFunction = DataFlowNode()->PyMorePythonFunction() ;
136   endService( "LNode_Impl::PyMore" );
137   return aPythonFunction ;
138 }
139
140 char * LNode_Impl::PyMoreName() {
141   beginService( "LNode_Impl::PyMoreName" );
142   char * RetVal = DataFlowNode()->PyMoreName() ;
143   endService( "LNode_Impl::PyMoreName" );
144   return CORBA::string_dup( RetVal ) ;
145 }
146
147 void LNode_Impl::SetPyNext( const char * NextName ,
148                             const SUPERV::ListOfStrings & aPyNext ) {
149   beginService( "LNode_Impl::SetPyNext" );
150   DataFlowNode()->SetPyNextPythonFunction( NextName , aPyNext ) ;
151   endService( "LNode_Impl::SetPyNext" );
152   return ;
153 }
154
155 SUPERV::ListOfStrings * LNode_Impl::PyNext() {
156   SUPERV::ListOfStrings * aPythonFunction ;
157   beginService( "LNode_Impl::PyNext" );
158   aPythonFunction = DataFlowNode()->PyNextPythonFunction() ;
159   endService( "LNode_Impl::PyNext" );
160   return aPythonFunction ;
161 }
162
163 char * LNode_Impl::PyNextName() {
164   beginService( "LNode_Impl::PyNextName" );
165   char * RetVal = DataFlowNode()->PyNextName() ;
166   endService( "LNode_Impl::PyNextName" );
167   return CORBA::string_dup( RetVal );
168 }
169
170