Salome HOME
08ed859bb759bc4089aa5dddecfdafc15c914445
[modules/superv.git] / src / GraphBase / DataFlowBase_DataPort.hxx
1 //  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : DataFlowBase_DataPort.hxx
25 //  Author : Jean Rahuel, CEA
26 //  Module : SUPERV
27 //  $Header:
28
29 #ifndef _DATAFLOWBASE_DATAPORT_HXX
30 #define _DATAFLOWBASE_DATAPORT_HXX
31
32 #include "DataFlowBase_Port.hxx"
33
34 namespace GraphBase {
35
36   class DataPort : public Port {
37
38     CORBA::Any const *    _InitialValue ;
39     CORBA::Any const *    _theValue ;
40     CORBA::Any const * *  _Value ;
41     SUPERV::GraphState    _State ;
42     bool                  _Done ;
43     pthread_mutex_t       _MutexWait ;
44
45     public :
46
47     DataPort( const char *const * NodeName  ,
48               const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ) ;
49     virtual ~DataPort() ;
50
51     void InitialValues(CORBA::Any aValue ) ;
52     void Value (const CORBA::Any & aValue ) ;
53     void Value( const CORBA::Any * aValue ) ;
54     void Value( const CORBA::Any ** aValue ) ;
55     CORBA::Any const * Value() const ;
56     bool BoolValue() const ;
57     const CORBA::Any ** ValuePtr() const ;
58
59     void State( SUPERV::GraphState aState ) {
60          _State = aState ; } ;
61     SUPERV::GraphState State() { return _State ; } ;
62
63     void Done( bool aDone ) {
64 //         cdebug << "ChgDone(.) " << NodeName() << " " << PortName() << " "
65 //                << _Done << " -> " << aDone << endl ;
66          _Done = aDone ; } ;
67     const bool Done() const { return ( _Done ) ; } ;
68
69     void StringValue(ostream & f) const ;
70
71   } ;
72
73 } ;
74 #endif