Salome HOME
c2ceff037c27b894e518e449f1460e961715078c
[modules/superv.git] / src / GraphBase / DataFlowBase_DataNode.hxx
1 //  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : DataFlowBase_DataNode.hxx
25 //  Author : Jean Rahuel, CEA
26 //  Module : SUPERV
27 //  $Header:
28
29 #ifndef _DATAFLOWBASE_DATANODE_HXX
30 #define _DATAFLOWBASE_DATANODE_HXX
31
32 #include "DataFlowBase_InLineNode.hxx"
33
34 namespace GraphBase {
35
36   class DataNode : public InLineNode {
37
38     private:
39
40       GraphBase::PortsOfNode * _DataFlowDataPorts ;
41       bool                     _Created ;
42
43     public:
44
45       DataNode() ;
46       DataNode( CORBA::ORB_ptr ORB ,
47                 SALOME_NamingService* ptrNamingService ,
48                 const char *DataFlowName ) ;
49       DataNode( CORBA::ORB_ptr ORB ,
50                 SALOME_NamingService* ptrNamingService ,
51                 const SALOME_ModuleCatalog::Service& DataFlowService ,
52                 const char *DataFlowName ,
53                 const SUPERV::KindOfNode DataFlowkind ,
54                 const SUPERV::SDate DataFlowFirstCreation ,
55                 const SUPERV::SDate DataFlowLastModification ,
56                 const char * DataFlowEditorRelease ,
57                 const char * DataFlowAuthor ,
58                 const char * DataFlowComment ) ;
59       virtual ~DataNode() ;
60
61       void DataService( CORBA::ORB_ptr ORB ,
62                         const SALOME_ModuleCatalog::Service aService ,
63                         int * Graph_prof_debug ,
64                         ofstream * Graph_fdebug ) ;
65
66       int CheckDataServerNodes() const ;
67
68 // Mirrored methods of _DataFlowDataPorts of DataNode :
69 // GetIn... gives the Out which is the input of InPort of the DataFlow
70 // GetOut... gives the In which gets the output of OutPort of the DataFlow
71       const int GetNodeInDataNodePortsSize() const {
72                 return _DataFlowDataPorts->GetNodeOutPortsSize() ; } ;
73       const OutPort *GetNodeInDataNodePort(int i) const {
74                     return _DataFlowDataPorts->GetNodeOutPort( i ) ; } ;
75       OutPort *GetChangeNodeInDataNodePort(int i) const {
76               return _DataFlowDataPorts->GetChangeNodeOutPort( i ) ; } ;
77       const int GetNodeOutDataNodePortsSize() const {
78                 return _DataFlowDataPorts->GetNodeInPortsSize() ; } ;
79       const InPort *GetNodeOutDataNodePort(int i) const {
80                    return _DataFlowDataPorts->GetNodeInPort( i ) ; } ;
81       InPort *GetChangeNodeOutDataNodePort(int i) const {
82              return _DataFlowDataPorts->GetChangeNodeInPort( i ) ; } ;
83
84       OutPort * GetChangeInDataNodePort( const char * DataFlowInPortName ) {
85                 return _DataFlowDataPorts->GetChangeOutPort( DataFlowInPortName ) ; } ;
86       InPort * GetChangeOutDataNodePort( const char * DataFlowOutPortName ) {
87                return _DataFlowDataPorts->GetChangeInPort( DataFlowOutPortName ) ; } ;
88
89       void DataNodeInfo(ostream & s ) const ;
90
91       void ListDatas(ostream & f) const ;
92
93 //      bool SaveXML( ostream &f , char *Tabs , 
94       bool SaveXML( QDomDocument & Graph , QDomElement & info , 
95                     int X , int Y ) const {
96            GraphBase::ListOfFuncName aFuncNames ; 
97            aFuncNames.resize( 0 ) ;
98            GraphBase::ListOfPythonFunctions aVoidList ;
99 //           return GraphBase::ComputingNode::SaveXML( f , Tabs , "" , "" , "" , "" ,
100            return GraphBase::ComputingNode::SaveXML( Graph , info , "" , "" , "" , "" ,
101                                                      aFuncNames , aVoidList , X , Y ) ; } ;
102
103       bool SavePY( ostream &f , const char * aGraphName ,
104                    int X , int Y ) const {
105            GraphBase::ListOfFuncName aFuncNames ; 
106            aFuncNames.resize( 0 ) ;
107            GraphBase::ListOfPythonFunctions aVoidList ;
108            return GraphBase::ComputingNode::SavePY( f , aGraphName , "" , "" , "" , NULL ,
109                                                     aFuncNames , aVoidList , X , Y ) ; } ;
110   } ;
111
112 } ;
113
114 #endif