2 //=============================================================================
3 // File : LNode_Impl.cxx
5 // Author : Jean Rahuel
8 //=============================================================================
15 #include "utilities.h"
17 #include "LNode_Impl.hxx"
19 LNode_Impl::LNode_Impl() {
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" );
43 _id = _poa->activate_object(_thisObj);
44 _Orb = CORBA::ORB::_duplicate(orb);
47 // DataFlowNode()->SetPyMorePythonFunction( MoreName , aMorePythonFunction ) ;
48 // DataFlowNode()->SetPyNextPythonFunction( NextName , aNextPythonFunction ) ;
49 endService( "LNode_Impl::LNode_Impl" );
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" );
64 _id = _poa->activate_object(_thisObj);
65 _Orb = CORBA::ORB::_duplicate(orb);
68 endService( "LNode_Impl::LNode_Impl" );
71 LNode_Impl::~LNode_Impl() {
72 beginService( "LNode_Impl::~LNode_Impl" );
73 endService( "LNode_Impl::~LNode_Impl" );
76 void LNode_Impl::destroy() {
77 beginService( "LNode_Impl::Destroy" );
78 if ( DataFlowEditor()->IsEditing() ) {
80 _poa->deactivate_object(*_id) ;
81 CORBA::release(_poa) ;
83 _thisObj->_remove_ref();
86 endService( "LNode_Impl::Destroy" );
89 bool LNode_Impl::Delete() {
90 // beginService( "LNode_Impl::Delete" );
92 if ( DataFlowEditor()->IsEditing() ) {
93 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
95 RetVal = DataFlowEditor()->IsValid() ;
97 // endService( "LNode_Impl::Delete" );
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" );
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 ;
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 ) ;
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" );
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 ;
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 ) ;
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" );
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 ;
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 );