39 #ifndef vtkSocketCommunicator_h
40 #define vtkSocketCommunicator_h
47 #ifdef VTK_WORDS_BIGENDIAN
48 # define vtkSwap4 vtkByteSwap::Swap4LE
49 # define vtkSwap4Range vtkByteSwap::Swap4LERange
50 # define vtkSwap8 vtkByteSwap::Swap8LE
51 # define vtkSwap8Range vtkByteSwap::Swap8LERange
53 # define vtkSwap4 vtkByteSwap::Swap4BE
54 # define vtkSwap4Range vtkByteSwap::Swap4BERange
55 # define vtkSwap8 vtkByteSwap::Swap8BE
56 # define vtkSwap8Range vtkByteSwap::Swap8BERange
72 virtual int WaitForConnection(
int port);
74 unsigned long msec = 0);
78 virtual void CloseConnection();
81 virtual int ConnectTo(
const char* hostName,
int port);
85 vtkGetMacro(SwapBytesInReceivedData,
int);
100 int remoteHandle,
int tag);
102 int remoteHandle,
int tag);
133 int operation,
int destProcessId);
136 Operation *operation,
int destProcessId);
148 vtkSetClampMacro(PerformHandshake,
int, 0, 1);
149 vtkBooleanMacro(PerformHandshake,
int);
150 vtkGetMacro(PerformHandshake,
int);
157 virtual void SetLogStream(ostream* stream);
158 virtual ostream* GetLogStream();
167 virtual int LogToFile(
const char*
name);
168 virtual int LogToFile(
const char*
name,
int append);
173 vtkSetMacro(ReportErrors,
int);
174 vtkGetMacro(ReportErrors,
int);
189 int ServerSideHandshake();
193 int ClientSideHandshake();
198 vtkGetMacro(IsServer,
int);
203 static int GetVersion();
213 { this->BufferMessage =
true; }
217 bool HasBufferredMessages();
238 int SendTagged(
const void*
data,
int wordSize,
int numWords,
int tag,
239 const char* logName);
240 int ReceiveTagged(
void*
data,
int wordSize,
int numWords,
int tag,
241 const char* logName);
242 int ReceivePartialTagged(
void*
data,
int wordSize,
int numWords,
int tag,
243 const char* logName);
245 int ReceivedTaggedFromBuffer(
246 void*
data,
int wordSize,
int numWords,
int tag,
const char* logName);
249 void FixByteOrder(
void*
data,
int wordSize,
int numWords);
252 void LogTagged(
const char*
name,
const void*
data,
int wordSize,
int numWords,
253 int tag,
const char* logName);
254 int CheckForErrorInternal(
int id);
260 int SelectSocket(
int socket,
unsigned long msec);
272 int TagMessageLength;
275 class vtkMessageBuffer;
276 vtkMessageBuffer* ReceivedMessageBuffer;
void BufferCurrentMessage()
virtual int GatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type, int destProcessId)
virtual int BroadcastVoidArray(void *data, vtkIdType length, int type, int srcProcessId)
#define VTKPARALLELCORE_EXPORT
Process communication using Sockets.
Encapsulate a socket that accepts connections.
virtual int AllGatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type)
virtual int ReceiveVoidArray(void *data, vtkIdType maxlength, int type, int remoteHandle, int tag)=0
virtual int ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation, int destProcessId)
a simple class to control print indentation
virtual int GatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int destProcessId)
virtual int ScatterVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int type, int srcProcessId)
virtual int SendVoidArray(const void *data, vtkIdType length, int type, int remoteHandle, int tag)=0
virtual void SetNumberOfProcesses(int num)
void PrintSelf(ostream &os, vtkIndent indent)
virtual int AllGatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type)
virtual int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation)
virtual int ScatterVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int srcProcessId)
Used to send/receive messages in a multiprocess environment.
Encapsulates a client socket.
int SwapBytesInReceivedData