Salome HOME
Fix for bug PAL12235 : Init values on input port not retrievable after write/read...
[modules/superv.git] / src / GraphBase / DataFlowBase_OutPort.hxx
index 35e73a2336ec79953ab25272eb8f26336cb8c388..ecc9e2a73cdf5f001a19a3d6fa4575c5b27e8412 100644 (file)
@@ -1,10 +1,30 @@
-//=============================================================================
-// File      : DataFlowBase_OutPort.hxx
-// Created   : 2002
-// Author    : Jean Rahuel, CEA
-// Project   : SALOME
-// $Header:
-//=============================================================================
+//  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//
+//
+//
+//  File   : DataFlowBase_OutPort.hxx
+//  Author : Jean Rahuel, CEA
+//  Module : SUPERV
+//  $Header:
 
 #ifndef _DATAFLOWBASE_OUTPORT_HXX
 #define _DATAFLOWBASE_OUTPORT_HXX
@@ -28,13 +48,15 @@ namespace GraphBase {
 
     public:   
 
+      OutPort() {
+      };
       OutPort( const char *const * NodeName  ,
                const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
-               const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ) :
-               DataPort( NodeName , aserviceParameter ) {
+               const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ,
+               const SALOME_ModuleCatalog::DataStreamDependency aDependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ) :
+               DataPort( NodeName , aserviceParameter , aKind , aDependency) {
                _Connected = NotConnected ;
-               _InPortsSize = 0 ;
-               Kind( aKind ) ; } ;
+               _InPortsSize = 0 ; } ;
       virtual ~OutPort() {
          cdebug << "GraphBase::OutPort::~OutPort " << PortName() << endl ; } ;
       virtual void destroy() {
@@ -48,20 +70,27 @@ namespace GraphBase {
          cdebug << "GraphBase::OutPort::destroy " << PortName() << " "
                 << NodeName() << endl ; } ;
 
+// PortStatus has a meaning :
+// It is NotConnected or PortConnected or DataConnected or ExternConnected
+// Even if an OutPort may be connected to several ports the PortStatus is unique
       const StatusOfPort PortStatus() const {
             return _Connected; } ;
-      void PortStatus(StatusOfPort c) { _Connected = c; } ;
+      void PortStatus( StatusOfPort PortSts ) {
+//           cdebug << "OutPort::PortStatus " << NodeName() << " " << PortName() << " "
+//                  << _Connected << " --> " << PortSts << endl ;
+           _Connected = PortSts ; } ;
       const bool IsNotConnected() const {
             return ( _Connected == NotConnected ) ; } ;
-      const bool IsConnected() const {
-            return ( _Connected != NotConnected ) ; } ;
+//      const bool IsConnected() const {
+//            return ( _Connected == PortConnected || _Connected == ExternConnected ) ; } ;
       const bool IsPortConnected() const {
-            return ( _Connected == PortConnected ||
-                     _Connected == PortAndDataConnected ) ; } ;
-      const bool IsPortAndDataConnected() const {
-            return ( _Connected == PortAndDataConnected ) ; } ;
+            return ( _Connected == PortConnected ) ; } ;
       const bool IsDataConnected() const {
             return ( _Connected == DataConnected ) ; } ;
+      const bool IsExternConnected() const {
+            return ( _Connected == ExternConnected ) ; } ;
+//      const bool IsPortAndDataConnected() const {
+//            return ( _Connected == PortAndDataConnected ) ; } ;
 
       const int InPortsSize() const {
             return _InPortsSize ; } ;
@@ -80,6 +109,7 @@ namespace GraphBase {
       bool AddInPort( InPort * toPort ) ;
       bool AddInPortObjRef( InPort * toPort , SUPERV::Link_var aLink ) ;
 
+      bool RemoveInPort() ;
       bool RemoveInPort( InPort * toPort ) ;
       bool ReNameInPort( const char* OldNodePortName ,
                          const char* NewNodePortName ) ;