1 // SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : LNode_Impl.cxx
8 // Author : Jean Rahuel
18 //#include "utilities.h"
20 #include "LNode_Impl.hxx"
22 LNode_Impl::LNode_Impl() {
25 LNode_Impl::LNode_Impl( CORBA::ORB_ptr orb ,
26 PortableServer::POA_ptr poa ,
27 PortableServer::ObjectId * contId ,
28 const char *instanceName ,
29 const char *interfaceName ,
30 GraphEditor::DataFlow * aDataFlowEditor ,
31 GraphBase::ListOfFuncName FuncNameList ,
32 GraphBase::ListOfPythonFunctions PythonFunctionList ,
33 // const char * InitName ,
34 // const SUPERV::ListOfStrings & anInitPythonFunction ,
35 // const char * MoreName ,
36 // const SUPERV::ListOfStrings & aMorePythonFunction ,
37 // const char * NextName ,
38 // const SUPERV::ListOfStrings & aNextPythonFunction ,
39 const SUPERV::KindOfNode NodeKindOfNode ) :
40 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
41 // GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , InitName , anInitPythonFunction , NodeKindOfNode ) {
42 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , FuncNameList , PythonFunctionList , NodeKindOfNode ) {
43 // MESSAGE( NodeName << " " );
44 beginService( "LNode_Impl::LNode_Impl" );
46 _id = _poa->activate_object(_thisObj);
47 _Orb = CORBA::ORB::_duplicate(orb);
50 // DataFlowNode()->SetPyMorePythonFunction( MoreName , aMorePythonFunction ) ;
51 // DataFlowNode()->SetPyNextPythonFunction( NextName , aNextPythonFunction ) ;
52 endService( "LNode_Impl::LNode_Impl" );
55 LNode_Impl::LNode_Impl( CORBA::ORB_ptr orb ,
56 PortableServer::POA_ptr poa ,
57 PortableServer::ObjectId * contId ,
58 const char *instanceName ,
59 const char *interfaceName ,
60 GraphEditor::DataFlow * aDataFlowEditor ,
61 GraphEditor::InNode * aDataFlowNode ) :
62 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
63 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
64 MESSAGE( DataFlowNode()->Name() << " " );
65 beginService( "LNode_Impl::LNode_Impl" );
67 _id = _poa->activate_object(_thisObj);
68 _Orb = CORBA::ORB::_duplicate(orb);
71 endService( "LNode_Impl::LNode_Impl" );
74 LNode_Impl::~LNode_Impl() {
75 beginService( "LNode_Impl::~LNode_Impl" );
76 endService( "LNode_Impl::~LNode_Impl" );
79 void LNode_Impl::destroy() {
80 beginService( "LNode_Impl::Destroy" );
81 if ( DataFlowEditor()->IsEditing() ) {
82 SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
84 _poa->deactivate_object(*_id) ;
85 CORBA::release(_poa) ;
87 _thisObj->_remove_ref();
89 if ( !CORBA::is_nil( aCoupled ) ) {
90 aCoupled->SetCoupled( "" ) ;
94 endService( "LNode_Impl::Destroy" );
97 bool LNode_Impl::Delete() {
98 beginService( "LNode_Impl::Delete" );
100 if ( DataFlowEditor()->IsEditing() ) {
102 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
104 RetVal = DataFlowEditor()->IsValid() ;
107 endService( "LNode_Impl::Delete" );
111 void LNode_Impl::SetPyInit( const char * InitName ,
112 const SUPERV::ListOfStrings & aPyInit ) {
113 beginService( "LNode_Impl::SetPyInit" );
114 SetPyFunction( InitName , aPyInit ) ;
115 endService( "LNode_Impl::SetPyInit" );
119 SUPERV::ListOfStrings * LNode_Impl::PyInit() {
120 SUPERV::ListOfStrings * aPythonFunction ;
121 beginService( "LNode_Impl::PyInit" );
122 aPythonFunction = PyFunction() ;
123 endService( "LNode_Impl::PyInit" );
124 return aPythonFunction ;
127 char * LNode_Impl::PyInitName() {
128 beginService( "LNode_Impl::PyInitName" );
129 char * RetVal = PyFuncName() ;
130 endService( "LNode_Impl::PyInitName" );
131 return CORBA::string_dup( RetVal ) ;
134 void LNode_Impl::SetPyMore( const char * MoreName ,
135 const SUPERV::ListOfStrings & aPyMore ) {
136 beginService( "LNode_Impl::SetPyMore" );
137 DataFlowNode()->SetPyMorePythonFunction( MoreName , aPyMore ) ;
138 endService( "LNode_Impl::SetPyMore" );
142 SUPERV::ListOfStrings * LNode_Impl::PyMore() {
143 SUPERV::ListOfStrings * aPythonFunction ;
144 beginService( "LNode_Impl::PyMore" );
145 aPythonFunction = DataFlowNode()->PyMorePythonFunction() ;
146 endService( "LNode_Impl::PyMore" );
147 return aPythonFunction ;
150 char * LNode_Impl::PyMoreName() {
151 beginService( "LNode_Impl::PyMoreName" );
152 char * RetVal = DataFlowNode()->PyMoreName() ;
153 endService( "LNode_Impl::PyMoreName" );
154 return CORBA::string_dup( RetVal ) ;
157 void LNode_Impl::SetPyNext( const char * NextName ,
158 const SUPERV::ListOfStrings & aPyNext ) {
159 beginService( "LNode_Impl::SetPyNext" );
160 DataFlowNode()->SetPyNextPythonFunction( NextName , aPyNext ) ;
161 endService( "LNode_Impl::SetPyNext" );
165 SUPERV::ListOfStrings * LNode_Impl::PyNext() {
166 SUPERV::ListOfStrings * aPythonFunction ;
167 beginService( "LNode_Impl::PyNext" );
168 aPythonFunction = DataFlowNode()->PyNextPythonFunction() ;
169 endService( "LNode_Impl::PyNext" );
170 return aPythonFunction ;
173 char * LNode_Impl::PyNextName() {
174 beginService( "LNode_Impl::PyNextName" );
175 char * RetVal = DataFlowNode()->PyNextName() ;
176 endService( "LNode_Impl::PyNextName" );
177 return CORBA::string_dup( RetVal );