Back to index

salome-kernel  6.5.0
Param_Double_Port_provides_i.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 //  File   : param_double_port_provides.hxx
00021 //  Author : André RIBES (EDF)
00022 //  Module : KERNEL
00023 //
00024 #ifndef _PARAM_DOUBLE_PORT_PROVIDES_HXX_
00025 #define _PARAM_DOUBLE_PORT_PROVIDES_HXX_
00026 
00027 #include "SALOME_ParamPortsPaCO_Ports_Param_Double_Port_server.hxx"
00028 
00029 #include "ParallelDSC_i.hxx"
00030 #include "PortProperties_i.hxx"
00031 
00032 class Param_Double_Port_provides_i :
00033   public virtual Ports::Param_Double_Port_serv
00034 {
00035   public :
00036     Param_Double_Port_provides_i(CORBA::ORB_ptr orb, char * ior, int rank);
00037     virtual ~Param_Double_Port_provides_i();
00038 
00039     void put(const Ports::Param_Double_Port::seq_double & param_data);
00040     void get_results(Ports::Param_Double_Port::seq_double_out param_results);
00041 
00042     // local methods
00043     Ports::Param_Double_Port::seq_double * get_data();
00044     void set_data(Ports::Param_Double_Port::seq_double * results);
00045     void configure_set_data(int data_length, 
00046                             int totalNbElt, 
00047                             int BeginEltPos);
00048 
00049     // Aide à la création du port
00050     static Param_Double_Port_provides_i * init_port(Engines_ParallelDSC_i * par_compo, 
00051                                                     std::string port_name,
00052                                                     CORBA::ORB_ptr orb);
00053 
00054     // Méthode temporaire en attendant d'avoir des méthodes parallèles bien synchronisé
00055     static void wait_init_port(Engines_ParallelDSC_i * par_compo, 
00056                                std::string port_name,
00057                                CORBA::ORB_ptr orb);
00058   private:
00059     // Buffers pour la réception et l'envoi
00060     Ports::Param_Double_Port::seq_double * _seq_data;
00061     Ports::Param_Double_Port::seq_double * _seq_results;
00062 
00063     // Variable pour la gestion du buffer de réception
00064     pthread_mutex_t * seq_data_mutex;
00065     pthread_cond_t * seq_data_condition;
00066     bool seq_data_termine;
00067     pthread_mutex_t * seq_data_mutex_cp;
00068     pthread_cond_t * seq_data_condition_cp;
00069     bool seq_data_termine_cp;
00070 
00071     // Variable pour la gestion du buffer d'envoi
00072     pthread_mutex_t * seq_results_mutex;
00073     pthread_cond_t * seq_results_condition;
00074     bool seq_results_termine;
00075     pthread_mutex_t * seq_results_mutex_cp;
00076     pthread_cond_t * seq_results_condition_cp;
00077     bool seq_results_termine_cp;
00078 };
00079 #endif