SALOME documentation central

src/DSC/DSC_User/Basic/data_short_port_provides.hxx

00001 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 //  Copyright (C) 2003-2007  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 //  File   : data_short_port_provides.hxx
00023 //  Author : André RIBES (EDF)
00024 //  Module : KERNEL
00025 //
00026 #ifndef _DATA_SHORT_PORT_PROVIDES_HXX_
00027 #define _DATA_SHORT_PORT_PROVIDES_HXX_
00028 
00029 #include <SALOMEconfig.h>
00030 
00031 #include <iostream>
00032 #include "SALOME_Ports.hh"
00033 #include "provides_port.hxx"
00034 #include <pthread.h>
00035 
00040 class data_short_port_provides :
00041   public virtual POA_Ports::Data_Short_Port,
00042   public virtual provides_port
00043 {
00044   public :
00045     data_short_port_provides();
00046     virtual ~data_short_port_provides();
00047 
00052     virtual void put(CORBA::Short data);
00053 
00060     virtual CORBA::Short get();
00061 
00067     virtual Ports::Port_ptr get_port_ref();
00068 
00069   private :
00070     CORBA::Short _val;
00071     pthread_mutex_t * short_mutex;
00072     pthread_cond_t * short_condition;
00073     bool short_termine;
00074     pthread_mutex_t * short_mutex_cp;
00075     pthread_cond_t * short_condition_cp;
00076     bool short_termine_cp;
00077 
00078 };
00079 
00080 #endif