src/GraphBase/DataFlowBase_DataNode.hxx

Go to the documentation of this file.
00001 //  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
00002 //
00003 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
00005 // 
00006 //  This library is free software; you can redistribute it and/or 
00007 //  modify it under the terms of the GNU Lesser General Public 
00008 //  License as published by the Free Software Foundation; either 
00009 //  version 2.1 of the License. 
00010 // 
00011 //  This library is distributed in the hope that it will be useful, 
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00014 //  Lesser General Public License for more details. 
00015 // 
00016 //  You should have received a copy of the GNU Lesser General Public 
00017 //  License along with this library; if not, write to the Free Software 
00018 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
00019 // 
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //
00023 //
00024 //  File   : DataFlowBase_DataNode.hxx
00025 //  Author : Jean Rahuel, CEA
00026 //  Module : SUPERV
00027 //  $Header:
00028 
00029 #ifndef _DATAFLOWBASE_DATANODE_HXX
00030 #define _DATAFLOWBASE_DATANODE_HXX
00031 
00032 #include "DataFlowBase_GOTONode.hxx"
00033 
00034 namespace GraphBase {
00035 
00036   class DataNode : public GOTONode {
00037 
00038     private:
00039 
00040       bool                     _Created ;
00041 
00042     protected :
00043 
00044       GraphBase::PortsOfNode * _DataFlowDataPorts ;
00045 
00046     public:
00047 
00048       DataNode() ;
00049       DataNode( CORBA::ORB_ptr ORB ,
00050                 SALOME_NamingService* ptrNamingService ,
00051                 const char *DataFlowName ,
00052                 const SUPERV::KindOfNode DataFlowkind ,
00053                 int * Graph_prof_debug ,
00054                 ofstream * Graph_fdebug ) ;
00055       DataNode( CORBA::ORB_ptr ORB ,
00056                 SALOME_NamingService* ptrNamingService ,
00057                 const SALOME_ModuleCatalog::Service& DataFlowService ,
00058                 const char *DataFlowName ,
00059                 const SUPERV::KindOfNode DataFlowkind ,
00060                 const SUPERV::SDate DataFlowFirstCreation ,
00061                 const SUPERV::SDate DataFlowLastModification ,
00062                 const char * DataFlowEditorRelease ,
00063                 const char * DataFlowAuthor ,
00064                 const char * DataFlowComment ) ;
00065       virtual ~DataNode() ;
00066 
00067       void DataService( CORBA::ORB_ptr ORB ,
00068                         const SALOME_ModuleCatalog::Service aService ,
00069                         int * Graph_prof_debug ,
00070                         ofstream * Graph_fdebug ) ;
00071 
00072       int CheckDataServerNodes() const ;
00073 
00074 // Mirrored methods of _DataFlowDataPorts of DataNode :
00075 // GetIn... gives the Out which is the input of InPort of the DataFlow
00076 // GetOut... gives the In which gets the output of OutPort of the DataFlow
00077       const int GetNodeInDataNodePortsSize() const {
00078                 return _DataFlowDataPorts->GetNodeOutPortsSize() ; } ;
00079       const OutPort *GetNodeInDataNodePort(int i) const {
00080                     return _DataFlowDataPorts->GetNodeOutPort( i ) ; } ;
00081       OutPort *GetChangeNodeInDataNodePort(int i) const {
00082               return _DataFlowDataPorts->GetChangeNodeOutPort( i ) ; } ;
00083       const int GetNodeOutDataNodePortsSize() const {
00084                 return _DataFlowDataPorts->GetNodeInPortsSize() ; } ;
00085       const InPort *GetNodeOutDataNodePort(int i) const {
00086                    return _DataFlowDataPorts->GetNodeInPort( i ) ; } ;
00087       InPort *GetChangeNodeOutDataNodePort(int i) const {
00088              return _DataFlowDataPorts->GetChangeNodeInPort( i ) ; } ;
00089 
00090       OutPort * GetChangeInDataNodePort( const char * DataFlowInPortName ) {
00091                 return _DataFlowDataPorts->GetChangeOutPort( DataFlowInPortName ) ; } ;
00092       InPort * GetChangeOutDataNodePort( const char * DataFlowOutPortName ) {
00093                return _DataFlowDataPorts->GetChangeInPort( DataFlowOutPortName ) ; } ;
00094 
00095       void DataNodeInfo(ostream & s ) const ;
00096 
00097       void ListDatas(ostream & f) const ;
00098 
00099 //      bool SaveXML( ostream &f , char *Tabs , 
00100       bool SaveXML( QDomDocument & Graph , QDomElement & info , 
00101                     int X , int Y ) const {
00102            GraphBase::ListOfFuncName aFuncNames ; 
00103            aFuncNames.resize( 0 ) ;
00104            GraphBase::ListOfPythonFunctions aVoidList ;
00105 //           return GraphBase::ComputingNode::SaveXML( f , Tabs , "" , "" , "" , "" ,
00106            return GraphBase::ComputingNode::SaveXML( Graph , info , "" , "" , "" , "" ,
00107                                                      aFuncNames , aVoidList , X , Y ) ; } ;
00108 
00109       bool SavePY( ostream &f , const char * aGraphName ,
00110                    int X , int Y ) const {
00111            GraphBase::ListOfFuncName aFuncNames ; 
00112            aFuncNames.resize( 0 ) ;
00113            GraphBase::ListOfPythonFunctions aVoidList ;
00114            return GraphBase::ComputingNode::SavePY( f , aGraphName , "" , "" , "" , NULL ,
00115                                                     aFuncNames , aVoidList , X , Y ) ; } ;
00116   } ;
00117 
00118 } ;
00119 
00120 #endif