1 #ifndef _SALOME_COMM_I_HXX_
2 #define _SALOME_COMM_I_HXX_
5 #include <SALOMEconfig.h>
6 #include CORBA_SERVER_HEADER(SALOME_Comm)
15 Generic servant class for senders that factorizes all the common methods and attributes necessary to senders.
16 All servant classes for senders have to inheritate from it.
18 class SALOME_Sender_i : public virtual POA_SALOME::Sender,
19 public PortableServer::RefCountServantBase {
21 /*! Pointer to the generic array to transmit*/
22 const void *_tabToSend;
23 /*! Length of the generic array to transmit*/
25 /*! it represents the sizeof() of each component of the generic array:\n
26 Practically in terms of bytes the size to be transmitted is _lgrTabToSend*_sizeOf
29 /*! Type the component of the array*/
30 SALOME::TypeOfDataTransmitted _type;
32 SALOME_Sender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf);
34 const void *getData(long &size) const;
35 int getSizeOf() const;
37 SALOME::TypeOfDataTransmitted getTypeOfDataTransmitted();
38 SALOME::Sender_ptr buildOtherWithProtocol(SALOME::TypeOfCommunication type);
39 static SALOME_Sender_i *find(SALOME::Sender_ptr pCorba);
42 /*! 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.
44 class SALOME_CorbaDoubleNCSender_i : public POA_SALOME::CorbaDoubleNCSender,
45 public SALOME_Sender_i
48 SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend);
49 ~SALOME_CorbaDoubleNCSender_i();
50 CORBA::ULong getSize();
51 SALOME::vectorOfDouble* sendPart(CORBA::ULong offset, CORBA::ULong length);
52 SALOME::vectorOfDouble* send();
55 /*! 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.
57 class SALOME_CorbaDoubleCSender_i : public POA_SALOME::CorbaDoubleCSender,
58 public SALOME_Sender_i
61 SALOME_CorbaDoubleCSender_i(const double *tabToSend,long lgrTabToSend);
62 ~SALOME_CorbaDoubleCSender_i();
63 CORBA::ULong getSize();
64 SALOME::vectorOfDouble* sendPart(CORBA::ULong offset, CORBA::ULong length);
67 /*! 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.
69 class SALOME_CorbaLongNCSender_i : public POA_SALOME::CorbaLongNCSender,
70 public SALOME_Sender_i
73 SALOME_CorbaLongNCSender_i(const int *tabToSend,long lgrTabToSend);
74 ~SALOME_CorbaLongNCSender_i();
75 CORBA::ULong getSize();
76 SALOME::vectorOfLong* sendPart(CORBA::ULong offset, CORBA::ULong length);
77 SALOME::vectorOfLong* send();
80 /*! 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.
82 class SALOME_CorbaLongCSender_i : public POA_SALOME::CorbaLongCSender,
83 public SALOME_Sender_i
86 SALOME_CorbaLongCSender_i(const int *tabToSend,long lgrTabToSend);
87 ~SALOME_CorbaLongCSender_i();
88 CORBA::ULong getSize();
89 SALOME::vectorOfLong* sendPart(CORBA::ULong offset, CORBA::ULong length);
90 SALOME::CorbaLongCSender_ptr _this();
95 /*! Servant class of sender using MPI2.
97 class SALOME_MPISender_i : public POA_SALOME::MPISender,
98 public SALOME_Sender_i
101 static unsigned long _tag1;
102 static unsigned long _tag2;
103 /*! Name of the port opened*/
106 /*! Tag 1 that identifies the transfert*/
108 /*! Tag 2 that identifies the transfert*/
110 /*! MPI communicator*/
112 /*! Array of pointer for asynchronous invocation with omnithread*/
114 /*! Pointer to thread created on asynchronous invocation*/
115 omni_thread *_newThr;
117 SALOME_MPISender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf);
118 ~SALOME_MPISender_i();
119 SALOME::MPISender::param* getParam();
121 void close(const SALOME::MPISender::param& p);
123 static void* myThread(void *args);
130 /*! Servant class of sender using Sockets.
132 class SALOME_SocketSender_i : public POA_SALOME::SocketSender,
133 public SALOME_Sender_i
139 std::string _IPAddress;
141 omni_thread *_newThr;
144 SALOME_SocketSender_i(SALOME::TypeOfDataTransmitted type,const void *tabToSend,long lgrTabToSend,int sizeOf);
145 ~SALOME_SocketSender_i();
146 SALOME::SocketSender::param* getParam();
148 void initCom() throw(SALOME::SALOME_Exception);
149 void acceptCom() throw(SALOME::SALOME_Exception);
153 static void* myThread(void *args);
154 std::string inetAddress();