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_InPort.hxx
25 // Author : Jean Rahuel, CEA
29 #ifndef _DATAFLOWBASE_INPORT_HXX
30 #define _DATAFLOWBASE_INPORT_HXX
32 #include "DataFlowBase_Port.hxx"
38 class InPort : public Port {
42 SUPERV::GraphState _State ;
44 OutPort * _InitialOutPort ;
49 InPort( const char *const * NodeName ,
50 const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
51 const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ,
52 const SALOME_ModuleCatalog::DataStreamDependency aDependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ) ;
54 cdebug << "GraphBase::InPort::~InPort " << PortName() << endl ; } ;
55 virtual void destroy() {
57 _InitialOutPort = NULL ;
58 cdebug << "GraphBase::InPort::destroy " << PortName() << " "
59 << NodeName() << endl ; } ;
61 void State( SUPERV::GraphState aState ) {
62 // cdebug << pthread_self() << " " << PortName() << " from "
63 // << NodeName() << " SUPERV::GraphState " << _State << " "
64 // << " --> " << aState << " _EndSwitchPort "
65 // << IsEndSwitch() << endl ;
67 SUPERV::GraphState State() { return _State ; } ;
69 OutPort * GetOutPort() {
71 OutPort * GetOutPort() const {
73 const StatusOfPort PortStatus() const ;
74 bool IsNotConnected() const ;
75 // bool IsConnected() const ;
76 bool IsPortConnected() const ;
77 bool IsDataConnected() const ;
78 bool IsExternConnected() const ;
79 bool AddOutPort( OutPort * anOutPort ) {
82 _OutPort = anOutPort ;
84 bool ChangeOutPort( OutPort * anOutPort ) ;
85 bool InitialOutPort() {
86 if ( _InitialOutPort ) {
87 _OutPort = _InitialOutPort ;
88 _InitialOutPort = NULL ;
92 bool RemoveOutPort() ;
94 void StringValue(ostream & f ) const ;
100 ostream & operator<< (ostream &,const GraphBase::InPort &);
102 ostream & operator<< (ostream &,const SUPERV::GraphState &);