1 #ifndef _SALOME_COMM_I_HXX_
2 #define _SALOME_COMM_I_HXX_
6 #include <SALOMEconfig.h>
7 #include CORBA_SERVER_HEADER(SALOME_Comm)
17 Generic servant class for senders that factorizes all the common methods and attributes necessary to senders.
18 All servant classes for senders have to inheritate from it.
20 class SALOME_Sender_i : public virtual POA_SALOME::Sender,
21 public PortableServer::RefCountServantBase {
23 /*! Pointer to the generic array to transmit*/
24 const void *_tabToSend;
25 /*! Length of the generic array to transmit*/
27 /*! it represents the sizeof() of each component of the generic array:\n
28 Practically in terms of bytes the size to be transmitted is _lgrTabToSend*_sizeOf
31 /*! Type the component of the array*/
32 SALOME::TypeOfDataTransmitted _type;
34 SALOME_Sender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf);
36 const void *getData(long &size) const;
37 int getSizeOf() const;
39 SALOME::TypeOfDataTransmitted getTypeOfDataTransmitted();
40 SALOME::Sender_ptr buildOtherWithProtocol(SALOME::TypeOfCommunication type);
41 static SALOME_Sender_i *find(SALOME::Sender_ptr pCorba);
44 /*! Servant class for CORBA sender for double* when no copy of array _tabToSend is required, that is to say double and CORBA::Double are binary equal.
46 class SALOME_CorbaDoubleNCSender_i : public POA_SALOME::CorbaDoubleNCSender,
47 public SALOME_Sender_i
50 SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend);
51 ~SALOME_CorbaDoubleNCSender_i();
52 CORBA::ULong getSize();
53 SALOME::vectorOfDouble* sendPart(CORBA::ULong offset, CORBA::ULong length);
54 SALOME::vectorOfDouble* send();
57 /*! Servant class for CORBA sender for double* when copy of array _tabToSend is required, that is to say double and CORBA::Double are NOT binary equal.
59 class SALOME_CorbaDoubleCSender_i : public POA_SALOME::CorbaDoubleCSender,
60 public SALOME_Sender_i
63 SALOME_CorbaDoubleCSender_i(const double *tabToSend,const long lgrTabToSend);
64 ~SALOME_CorbaDoubleCSender_i();
65 CORBA::ULong getSize();
66 SALOME::vectorOfDouble* sendPart(CORBA::ULong offset, CORBA::ULong length);
69 /*! Servant class for CORBA sender for int* when no copy of array _tabToSend is required, that is to say int and CORBA::Long are binary equal.
71 class SALOME_CorbaLongNCSender_i : public POA_SALOME::CorbaLongNCSender,
72 public SALOME_Sender_i
75 SALOME_CorbaLongNCSender_i(const int *tabToSend,const long lgrTabToSend);
76 ~SALOME_CorbaLongNCSender_i();
77 CORBA::ULong getSize();
78 SALOME::vectorOfLong* sendPart(CORBA::ULong offset, CORBA::ULong length);
79 SALOME::vectorOfLong* send();
82 /*! Servant class for CORBA sender for int* when copy of array _tabToSend is required, that is to say int and CORBA::Long are NOT binary equal.
84 class SALOME_CorbaLongCSender_i : public POA_SALOME::CorbaLongCSender,
85 public SALOME_Sender_i
88 SALOME_CorbaLongCSender_i(const int *tabToSend,long lgrTabToSend);
89 ~SALOME_CorbaLongCSender_i();
90 CORBA::ULong getSize();
91 SALOME::vectorOfLong* sendPart(CORBA::ULong offset, CORBA::ULong length);
92 SALOME::CorbaLongCSender_ptr _this();
97 /*! Servant class of sender using MPI2.
99 class SALOME_MPISender_i : public POA_SALOME::MPISender,
100 public SALOME_Sender_i
103 static unsigned long _tag1;
104 static unsigned long _tag2;
105 /*! Name of the port opened*/
108 /*! Tag 1 that identifies the transfert*/
110 /*! Tag 2 that identifies the transfert*/
112 /*! MPI communicator*/
114 /*! Array of pointer for asynchronous invocation with omnithread*/
116 /*! Pointer to thread created on asynchronous invocation*/
117 omni_thread *_newThr;
119 SALOME_MPISender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf);
120 ~SALOME_MPISender_i();
121 SALOME::MPISender::param* getParam();
123 void close(const SALOME::MPISender::param& p);
125 static void* myThread(void *args);
132 /*! Servant class of sender using Sockets.
134 class SALOME_SocketSender_i : public POA_SALOME::SocketSender,
135 public SALOME_Sender_i
141 std::string _IPAddress;
143 omni_thread *_newThr;
146 SALOME_SocketSender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf);
147 ~SALOME_SocketSender_i();
148 SALOME::SocketSender::param* getParam();
150 void initCom() throw(SALOME::SALOME_Exception);
151 void acceptCom() throw(SALOME::SALOME_Exception);
155 static void* myThread(void *args);
156 std::string inetAddress();