1 //=============================================================================
2 // File : DataFlowBase_InPort.hxx
4 // Author : Jean Rahuel, CEA
7 //=============================================================================
9 #ifndef _DATAFLOWBASE_INPORT_HXX
10 #define _DATAFLOWBASE_INPORT_HXX
12 #include "DataFlowBase_Port.hxx"
18 class InPort : public Port {
20 SUPERV::GraphState _State ;
22 OutPort * _InitialOutPort ;
27 cout << "InPort()" << endl ;
28 _State = SUPERV::UndefinedState ;
30 _InitialOutPort = NULL ;
32 InPort( const char *const * NodeName ,
33 const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
34 const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ) ;
36 cdebug << "GraphBase::InPort::~InPort " << PortName() << endl ; } ;
37 virtual void destroy() {
39 _InitialOutPort = NULL ;
40 cdebug << "GraphBase::InPort::destroy " << PortName() << " "
41 << NodeName() << endl ; } ;
43 void State( SUPERV::GraphState aState ) {
44 cdebug << pthread_self() << " " << PortName() << " from "
45 << NodeName() << " SUPERV::GraphState " << _State << " "
46 << " --> " << aState << " _EndSwitchPort "
47 << IsEndSwitch() << endl ;
49 SUPERV::GraphState State() { return _State ; } ;
51 OutPort * GetOutPort() {
53 OutPort * GetOutPort() const {
55 bool IsConnected() const ;
56 bool IsDataConnected() const ;
57 bool AddOutPort( OutPort * anOutPort ) {
60 _OutPort = anOutPort ;
62 bool ChangeOutPort( OutPort * anOutPort ) {
63 if ( _InitialOutPort == NULL ) {
64 _InitialOutPort = _OutPort ;
66 _OutPort = anOutPort ;
68 bool InitialOutPort() {
69 if ( _InitialOutPort ) {
70 _OutPort = _InitialOutPort ;
71 _InitialOutPort = NULL ;
75 bool RemoveOutPort() {
76 if ( _OutPort == NULL )
79 return RemoveCoords() ; } ;
81 void StringValue(ostream & f ) const ;
87 ostream & operator<< (ostream &,const GraphBase::InPort &);