1 // SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : DataFlowBase_DataNode.cxx
25 // Author : Jean Rahuel, CEA
30 #include "DataFlowBase_DataNode.hxx"
32 GraphBase::DataNode::DataNode() :
34 MESSAGE( "GraphBase::DataNode::DataNode" );
38 GraphBase::DataNode::DataNode( CORBA::ORB_ptr ORB ,
39 SALOME_NamingService* ptrNamingService ,
40 const char *DataFlowName ) :
41 InLineNode( ORB , ptrNamingService , DataFlowName ) {
42 MESSAGE( "GraphBase::DataNode::DataNode" );
46 GraphBase::DataNode::DataNode(
48 SALOME_NamingService* ptrNamingService ,
49 const SALOME_ModuleCatalog::Service& DataFlowService ,
50 const char *DataFlowName ,
51 const SUPERV::KindOfNode DataFlowkind ,
52 const SUPERV::SDate DataFlowFirstCreation ,
53 const SUPERV::SDate DataFlowLastModification ,
54 const char * DataFlowEditorRelease ,
55 const char * DataFlowAuthor ,
56 const char * DataFlowComment ) :
57 InLineNode( ORB , ptrNamingService , DataFlowService ,
58 DataFlowName , DataFlowkind ,
59 DataFlowFirstCreation , DataFlowLastModification ,
60 DataFlowEditorRelease , DataFlowAuthor ,
61 DataFlowComment , false , 0 , 0) {
62 // MESSAGE( "GraphBase::DataNode::DataNode" );
65 GraphBase::DataNode::~DataNode() {
66 // MESSAGE( "GraphBase::DataNode::~DataNode" );
69 void GraphBase::DataNode::DataService(
71 SALOME_ModuleCatalog::Service aService ,
72 int * Graph_prof_debug ,
73 ostream * Graph_fdebug ) {
74 // cout << "GraphBase::DataNode::DataService : DataFlowPortsOfNode of "
75 // << aService.ServiceName << endl ;
76 // DefPortsOfNode( aService , aService.ServiceName ) ;
77 DefPortsOfNode( ORB , aService , NamePtr() , Kind() ,
78 // true , false , false , false ,
79 Graph_prof_debug , Graph_fdebug ) ;
82 delete _DataFlowDataPorts ;
83 SALOME_ModuleCatalog::Service aReversedService ;
84 aReversedService.ServiceName = aService.ServiceName ;
85 aReversedService.ServiceinParameter = aService.ServiceoutParameter ;
86 aReversedService.ServiceoutParameter = aService.ServiceinParameter ;
87 _DataFlowDataPorts = new PortsOfNode() ;
88 // cout << "GraphBase::DataNode::DataService : Mirrored DataFlowPortsOfNode of "
89 // << aReversedService.ServiceName << endl ;
90 _DataFlowDataPorts->DefPortsOfNode( ORB , aReversedService , NamePtr() ,
92 // true , false , false , false ,
93 Graph_prof_debug , Graph_fdebug ) ;
97 int GraphBase::DataNode::CheckDataServerNodes() const {
99 cdebug << "GraphBase::Graph::DataServerNodes ()" << endl;
103 for ( i = 0 ; i < _DataFlowDataPorts->GetNodeOutPortsSize() ; i++ ) {
104 if ( !_DataFlowDataPorts->GetNodeOutPort(i)->IsDataConnected() ) {
105 cdebug << "InPort " << _DataFlowDataPorts->GetNodeOutPort(i)->PortName()
106 << " of DataFlow " << Name() << " has NO Data." << endl ;
110 cdebug << "InPort " << _DataFlowDataPorts->GetNodeOutPort(i)->PortName()
111 << " of DataFlow " << Name() << " has Data : "
112 // << _DataFlowDataPorts->GetNodeOutPort(i)->Value() << " kind "
113 // << _DataFlowDataPorts->GetNodeOutPort(i)->Kind()
118 for ( i = 0 ; i < _DataFlowDataPorts->GetNodeInPortsSize() ; i++ ) {
119 if ( !_DataFlowDataPorts->GetNodeInPort(i)->IsConnected() ) {
120 cdebug << "OutPort " << _DataFlowDataPorts->GetNodeInPort(i)->PortName()
121 << " of DataFlow " << Name() << " has Data " << endl ;
125 cdebug << "OutPort " << _DataFlowDataPorts->GetNodeInPort(i)->PortName()
126 << " of DataFlow " << Name() << " has NO Data : "
127 // << _DataFlowDataPorts->GetChangeNodeInPort(i)->GetLink()->Value()
129 // << _DataFlowDataPorts->GetChangeNodeInPort(i)->GetLink()->Kind()
136 cdebug << "Some Input Data missing in the DataFlow " << Name() << endl ;
142 void GraphBase::DataNode::ListDatas(ostrstream & f ) const {
143 _DataFlowDataPorts->ListPorts( f , false ) ;
146 void GraphBase::DataNode::DataNodeInfo(ostrstream & s ) const {
149 s << "Ports :" << endl ;
150 ListPorts( s , true ) ;
151 s << "Datas :" << endl ;
152 _DataFlowDataPorts->ListPorts( s , false ) ;
157 //GraphBase::OutPort * GraphBase::DataNode::GetChangeInDataNodePort( const char * DataFlowInPortName ) {
158 // return _DataFlowDataPorts->GetChangeOutPort( DataFlowInPortName ) ;
161 //GraphBase::InPort * GraphBase::DataNode::GetChangeOutDataNodePort( const char * DataFlowOutPortName ) {
162 // return _DataFlowDataPorts->GetChangeInPort( DataFlowOutPortName ) ;