]> SALOME platform Git repositories - modules/kernel.git/blob - src/Communication/SenderFactory.hxx
Salome HOME
Implemented a possibility to dlopen SalomeDS libarary and create SObject, Study,...
[modules/kernel.git] / src / Communication / SenderFactory.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/
19 //
20 #ifndef _SENDERFACTORY_HXX_
21 #define _SENDERFACTORY_HXX_
22
23 #include "MultiCommException.hxx"
24 #include <SALOMEconfig.h>
25 #include CORBA_SERVER_HEADER(SALOME_Comm)
26
27 class SALOMEMultiComm;
28
29 class SALOME_SenderDouble_i;
30 class SALOME_SenderInt_i;
31
32 /*!
33   This class implements the factory pattern of GoF by making a sender by giving an array and a communicator.It completely hides the type of sender from the user.
34  */
35 class SenderFactory
36 {
37 public:
38   static SALOME::SenderDouble_ptr buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr,bool ownTab=false) throw(MultiCommException);
39   static SALOME::SenderInt_ptr buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr,bool ownTab=false) throw(MultiCommException);
40   static SALOME::SenderDouble_ptr buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderDouble_i *src);
41   static SALOME::SenderInt_ptr buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderInt_i *src);
42 };
43
44 template<class T>
45 struct mapCppSender {
46   typedef T SenderVarType;
47 };
48
49 template<>
50 struct mapCppSender<int>
51 {
52   typedef SALOME::SenderInt_var SenderVarType;
53 };
54
55 template<>
56 struct mapCppSender<double>
57 {
58   typedef SALOME::SenderDouble_var SenderVarType;
59 };
60
61 #endif
62