1 #include "SenderFactory.hxx"
3 #include "SALOMEMultiComm.hxx"
4 #include "SALOME_Comm_i.hxx"
7 #ifdef COMP_CORBA_DOUBLE
8 #define SALOME_CorbaDoubleSender SALOME_CorbaDoubleNCSender_i
10 #define SALOME_CorbaDoubleSender SALOME_CorbaDoubleCSender_i
13 #ifdef COMP_CORBA_LONG
14 #define SALOME_CorbaLongSender SALOME_CorbaLongNCSender_i
16 #define SALOME_CorbaLongSender SALOME_CorbaLongCSender_i
19 SALOME::SenderDouble_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr,bool ownTab)throw(MultiCommException){
20 switch(multiCommunicator.getProtocol())
24 SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab);
30 SALOME_MPISenderDouble_i* retm=new SALOME_MPISenderDouble_i(tab,lgr,ownTab);
37 SALOME_SocketSenderDouble_i* rets=new SALOME_SocketSenderDouble_i(tab,lgr,ownTab);
43 multiCommunicator.setProtocol(SALOME::CORBA_);
44 MESSAGE("PROTOCOL CHANGED TO CORBA");
45 SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab);
48 // throw MultiCommException("Communication protocol not implemented");
52 SALOME::SenderInt_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr,bool ownTab)throw(MultiCommException){
53 switch(multiCommunicator.getProtocol())
57 SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab);
63 SALOME_MPISenderInt_i* retm=new SALOME_MPISenderInt_i(tab,lgr,ownTab);
70 SALOME_SocketSenderInt_i* rets=new SALOME_SocketSenderInt_i(tab,lgr,ownTab);
76 multiCommunicator.setProtocol(SALOME::CORBA_);
77 SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab);
80 // throw MultiCommException("Communication protocol not implemented");
84 SALOME::SenderDouble_ptr SenderFactory::buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderDouble_i *src)
86 SALOMEMultiComm mc(NewType);
88 const double *data=(const double *)src->getData(n);
89 bool own=src->getOwnerShip();
90 src->setOwnerShip(false);
91 return buildSender(mc,data,n,own);
94 SALOME::SenderInt_ptr SenderFactory::buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderInt_i *src)
96 SALOMEMultiComm mc(NewType);
98 const int *data=(const int *)src->getData(n);
99 bool own=src->getOwnerShip();
100 src->setOwnerShip(false);
101 return buildSender(mc,data,n,own);