39 #ifndef __vtkSocketCommunicator_h
40 #define __vtkSocketCommunicator_h
46 #ifdef VTK_WORDS_BIGENDIAN
47 # define vtkSwap4 vtkByteSwap::Swap4LE
48 # define vtkSwap4Range vtkByteSwap::Swap4LERange
49 # define vtkSwap8 vtkByteSwap::Swap8LE
50 # define vtkSwap8Range vtkByteSwap::Swap8LERange
52 # define vtkSwap4 vtkByteSwap::Swap4BE
53 # define vtkSwap4Range vtkByteSwap::Swap4BERange
54 # define vtkSwap8 vtkByteSwap::Swap8BE
55 # define vtkSwap8Range vtkByteSwap::Swap8BERange
71 virtual int WaitForConnection(
int port);
73 unsigned long msec = 0);
77 virtual void CloseConnection();
80 virtual int ConnectTo(
const char* hostName,
int port);
84 vtkGetMacro(SwapBytesInReceivedData,
int);
99 int remoteHandle,
int tag);
101 int remoteHandle,
int tag);
132 int operation,
int destProcessId);
135 Operation *operation,
int destProcessId);
147 vtkSetClampMacro(PerformHandshake,
int, 0, 1);
148 vtkBooleanMacro(PerformHandshake,
int);
149 vtkGetMacro(PerformHandshake,
int);
156 virtual void SetLogStream(ostream* stream);
157 virtual ostream* GetLogStream();
166 virtual int LogToFile(
const char*
name);
167 virtual int LogToFile(
const char*
name,
int append);
172 vtkSetMacro(ReportErrors,
int);
173 vtkGetMacro(ReportErrors,
int);
188 int ServerSideHandshake();
192 int ClientSideHandshake();
197 vtkGetMacro(IsServer,
int);
219 int SendTagged(
const void*
data,
int wordSize,
int numWords,
int tag,
220 const char* logName);
221 int ReceiveTagged(
void*
data,
int wordSize,
int numWords,
int tag,
222 const char* logName);
223 int ReceivePartialTagged(
void*
data,
int wordSize,
int numWords,
int tag,
224 const char* logName);
227 void LogTagged(
const char*
name,
const void*
data,
int wordSize,
int numWords,
228 int tag,
const char* logName);
229 int CheckForErrorInternal(
int id);
235 int SelectSocket(
int socket,
unsigned long msec);
247 int TagMessageLength;
252 static int GetVersion();
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)
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