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 : FNode_Impl.cxx
8 // Author : Jean Rahuel
18 //#include "utilities.h"
20 #include "FNode_Impl.hxx"
22 FNode_Impl::FNode_Impl() {
25 FNode_Impl::FNode_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 const SALOME_ModuleCatalog::Service &NodeService ,
32 const char * NodeComponentName ,
33 const char * NodeInterfaceName ,
34 const char * NodeName ,
35 const SUPERV::KindOfNode NodeKindOfNode ) :
36 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
37 CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , NodeService , NodeName , NodeKindOfNode , NULLSTRING ) {
38 // MESSAGE( NodeName << " " );
39 beginService( "FNode_Impl::FNode_Impl" );
40 // cout << "FNode_Impl::FNode_Impl -->" << endl ;
42 _id = _poa->activate_object(_thisObj);
43 _Orb = CORBA::ORB::_duplicate(orb);
46 // DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
47 // NodeInterfaceName , NodeName ,
48 // NodeKindOfNode ) ) ;
49 DataFlowNode()->ComponentName( NodeComponentName ) ;
50 DataFlowNode()->InterfaceName( NodeInterfaceName ) ;
51 endService( "FNode_Impl::FNode_Impl" );
52 // cout << "<-- FNode_Impl::FNode_Impl" << endl ;
55 FNode_Impl::FNode_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 CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
64 MESSAGE( DataFlowNode()->Name() << " " );
65 beginService( "FNode_Impl::FNode_Impl" );
67 _id = _poa->activate_object(_thisObj);
68 _Orb = CORBA::ORB::_duplicate(orb);
71 endService( "FNode_Impl::FNode_Impl" );
74 FNode_Impl::~FNode_Impl() {
75 beginService( "FNode_Impl::~Node_Impl" );
76 endService( "FNode_Impl::~Node_Impl" );
79 void FNode_Impl::destroy() {
80 beginService( "FNode_Impl::Destroy" );
81 if ( DataFlowEditor()->IsEditing() ) {
83 _poa->deactivate_object(*_id) ;
84 CORBA::release(_poa) ;
86 _thisObj->_remove_ref();
89 // endService( "FNode_Impl::Destroy" );
92 bool FNode_Impl::Delete() {
93 // beginService( "FNode_Impl::Delete" );
95 if ( DataFlowEditor()->IsEditing() ) {
97 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
99 RetVal = DataFlowEditor()->IsValid() ;
101 // endService( "FNode_Impl::Delete" );
105 char * FNode_Impl::GetComponentName() {
106 // beginService( "FNode_Impl::GetComponentName" );
107 char * RetVal = DataFlowNode()->ComponentName() ;
108 // endService( "FNode_Impl::GetComponentName" );
109 return CORBA::string_dup( RetVal );
111 bool FNode_Impl::SetComponentName( const char * aComponentName ) {
112 // beginService( "FNode_Impl::SetComponentName" );
113 bool RetVal = false ;
114 RetVal = DataFlowNode()->ComponentName( aComponentName ) ;
115 // endService( "FNode_Impl::SetComponentName" );
118 char * FNode_Impl::GetInterfaceName() {
119 // beginService( "FNode_Impl::GetInterfaceName" );
120 char * RetVal = DataFlowNode()->InterfaceName() ;
121 // endService( "FNode_Impl::GetInterfaceName" );
122 return CORBA::string_dup( RetVal );
124 bool FNode_Impl::SetInterfaceName( const char * anInterfaceName ) {
125 // beginService( "FNode_Impl::SetInterfaceName" );
126 bool RetVal = false ;
127 RetVal = DataFlowNode()->InterfaceName( anInterfaceName ) ;
128 // endService( "FNode_Impl::SetInterfaceName" );
131 char * FNode_Impl::GetContainer() {
132 // beginService( "FNode_Impl::GetContainer" );
133 char * RetVal = DataFlowNode()->Computer() ;
134 // endService( "FNode_Impl::GetContainer" );
135 return CORBA::string_dup( RetVal ) ;
137 bool FNode_Impl::SetContainer( const char * aDataFlowContainer ) {
138 // beginService( "FNode_Impl::SetContainer" );
139 bool RetVal = false ;
140 // GraphExecutor::DataFlow * _DataFlowExecutor = DataFlowEditor()->Executor() ;
141 // if ( DataFlowEditor()->IsEditing() ) {
142 RetVal = DataFlowNode()->Computer( aDataFlowContainer ) ;
144 // else if ( _DataFlowExecutor && ( _DataFlowExecutor->IsSuspended() ||
145 // _DataFlowExecutor->IsSuspended( DataFlowNode()->Name() ) ) ) {
146 // if ( _DataFlowExecutor->Graph()->GetChangeGraphNode( DataFlowNode()->Name() ) ) {
147 // RetVal = ((GraphEditor::InNode * ) _DataFlowExecutor->Graph()->GetChangeGraphNode( DataFlowNode()->Name() )->GetInNode())->Computer( aDataFlowContainer ) ;
148 DataFlowEditor()->UnValid() ;
151 // endService( "FNode_Impl::SetContainer" );