src/GraphBase/DataFlowBase_DataPort.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_DataPort.hxx
00025 //  Author : Jean Rahuel, CEA
00026 //  Module : SUPERV
00027 //  $Header:
00028 
00029 #ifndef _DATAFLOWBASE_DATAPORT_HXX
00030 #define _DATAFLOWBASE_DATAPORT_HXX
00031 
00032 #include "DataFlowBase_Port.hxx"
00033 
00034 namespace GraphBase {
00035 
00036   class DataPort : public Port {
00037 
00038     private:
00039 
00040       CORBA::Any const *    _InitialValue ;
00041       CORBA::Any const *    _theValue ;
00042       CORBA::Any const * *  _Value ;
00043 //JR 08.03.2005 : the fields (and corresponding methods) _PortState and _Done are redundant
00044 // probably. That should be clarified when I shall have time enough
00045       SUPERV::GraphState    _PortState ;
00046       bool                  _Done ;
00047       pthread_mutex_t       _MutexWait ;
00048 
00049       void SetValue( const CORBA::Any * aValue ) ;
00050 
00051     public :
00052 
00053       DataPort() ;
00054       DataPort( const char *const * NodeName  ,
00055                 const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
00056                 const SUPERV::KindOfPort aKind = SUPERV::ServiceParameter ,
00057                 const SALOME_ModuleCatalog::DataStreamDependency aDependency = SALOME_ModuleCatalog::DATASTREAM_UNDEFINED ) ;
00058       virtual ~DataPort() ;
00059 
00060       void InitialValues(CORBA::Any aValue ) ;
00061 //SetValue is under the control of _MutexWait because of concurrent access with Value()
00062       void SetValue (const CORBA::Any & aValue ) ;
00063       const CORBA::Any Value() const ;
00064       bool BoolValue() const ;
00065 
00066 //PortState is NOT under the control of _MutexWait because there is no problem of concurrent access
00067       void PortState( SUPERV::GraphState aPortState ) {
00068            _PortState = aPortState ; } ;
00069       SUPERV::GraphState PortState() { return _PortState ; } ;
00070 
00071 //PortDone is NOT under the control of _MutexWait because there is no problem of concurrent access
00072       void PortDone( bool aDone ) {
00073 //           cdebug << "ChgDone(.) " << NodeName() << " " << PortName() << " "
00074 //                  << _Done << " -> " << aDone << endl ;
00075            _Done = aDone ; } ;
00076       const bool PortDone() const { return ( _Done ) ; } ;
00077 
00078       void StringValue(ostream & f) const ;
00079 
00080   } ;
00081 
00082 } ;
00083 #endif