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 {
40 SUPERV::GraphState _State ;
42 OutPort * _InitialOutPort ;
47 // cout << "InPort()" << endl ;
48 _State = SUPERV::UndefinedState ;
50 _InitialOutPort = NULL ;
52 InPort( const char *const * NodeName ,
53 const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
54 const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ) ;
56 cdebug << "GraphBase::InPort::~InPort " << PortName() << endl ; } ;
57 virtual void destroy() {
59 _InitialOutPort = NULL ;
60 cdebug << "GraphBase::InPort::destroy " << PortName() << " "
61 << NodeName() << endl ; } ;
63 void State( SUPERV::GraphState aState ) {
64 // cdebug << pthread_self() << " " << PortName() << " from "
65 // << NodeName() << " SUPERV::GraphState " << _State << " "
66 // << " --> " << aState << " _EndSwitchPort "
67 // << IsEndSwitch() << endl ;
69 SUPERV::GraphState State() { return _State ; } ;
71 OutPort * GetOutPort() {
73 OutPort * GetOutPort() const {
75 bool IsConnected() const ;
76 bool IsDataConnected() const ;
77 bool AddOutPort( OutPort * anOutPort ) {
80 _OutPort = anOutPort ;
82 bool ChangeOutPort( OutPort * anOutPort ) {
83 if ( _InitialOutPort == NULL ) {
84 _InitialOutPort = _OutPort ;
86 _OutPort = anOutPort ;
88 bool InitialOutPort() {
89 if ( _InitialOutPort ) {
90 _OutPort = _InitialOutPort ;
91 _InitialOutPort = NULL ;
95 bool RemoveOutPort() {
96 if ( _OutPort == NULL )
99 return RemoveCoords() ; } ;
101 void StringValue(ostream & f ) const ;
107 ostream & operator<< (ostream &,const GraphBase::InPort &);