25#ifndef vtkSocketCommunicator_h 
   26#define vtkSocketCommunicator_h 
   30#include "vtkParallelCoreModule.h"  
   34#ifdef VTK_WORDS_BIGENDIAN 
   35#define vtkSwap4 vtkByteSwap::Swap4LE 
   36#define vtkSwap4Range vtkByteSwap::Swap4LERange 
   37#define vtkSwap8 vtkByteSwap::Swap8LE 
   38#define vtkSwap8Range vtkByteSwap::Swap8LERange 
   40#define vtkSwap4 vtkByteSwap::Swap4BE 
   41#define vtkSwap4Range vtkByteSwap::Swap4BERange 
   42#define vtkSwap8 vtkByteSwap::Swap8BE 
   43#define vtkSwap8Range vtkByteSwap::Swap8BERange 
   46VTK_ABI_NAMESPACE_BEGIN
 
   74  virtual int ConnectTo(
const char* hostName, 
int port);
 
   80  vtkGetMacro(SwapBytesInReceivedData, 
int);
 
  101    const void* data, 
vtkIdType length, 
int type, 
int remoteHandle, 
int tag) 
override;
 
  119    int destProcessId) 
override;
 
  123    int srcProcessId) 
override;
 
  127    const void* sendBuffer, 
void* recvBuffer, 
vtkIdType length, 
int type) 
override;
 
  131    int operation, 
int destProcessId) 
override;
 
  133    Operation* operation, 
int destProcessId) 
override;
 
  135    const void* sendBuffer, 
void* recvBuffer, 
vtkIdType length, 
int type, 
int operation) 
override;
 
  175  vtkSetMacro(ReportErrors, 
int);
 
  176  vtkGetMacro(ReportErrors, 
int);
 
  212  vtkGetMacro(IsServer, 
int);
 
  253  int SendTagged(
const void* data, 
int wordSize, 
int numWords, 
int tag, 
const char* logName);
 
  254  int ReceiveTagged(
void* data, 
int wordSize, 
int numWords, 
int tag, 
const char* logName);
 
  258    void* data, 
int wordSize, 
int numWords, 
int tag, 
const char* logName);
 
  267    const char* name, 
const void* data, 
int wordSize, 
int numWords, 
int tag, 
const char* logName);
 
  275  int SelectSocket(
int socket, 
unsigned long msec);
 
  288  int TagMessageLength;
 
  291  class vtkMessageBuffer;
 
  292  vtkMessageBuffer* ReceivedMessageBuffer;
 
Encapsulates a client socket.
 
A custom operation to use in a reduce command.
 
Used to send/receive messages in a multiprocess environment.
 
a simple class to control print indentation
 
Encapsulate a socket that accepts connections.
 
Process communication using Sockets.
 
int ReceiveVoidArray(void *data, vtkIdType length, int type, int remoteHandle, int tag) override
Performs the actual communication.
 
int ClientSideHandshake()
Performs ClientSide handshake.
 
int BroadcastVoidArray(void *data, vtkIdType length, int type, int srcProcessId) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
int Handshake()
Performs handshake.
 
vtkTypeBool PerformHandshake
 
int GatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int destProcessId) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
virtual int LogToFile(const char *name, int append)
Log messages to the given file.
 
virtual int ConnectTo(const char *hostName, int port)
Open a connection to host.
 
int ServerSideHandshake()
Performs ServerSide handshake.
 
void Barrier() override
This class foolishly breaks the conventions of the superclass, so this overload fixes the method.
 
int GetIsConnected()
Is the communicator connected?.
 
int SendVoidArray(const void *data, vtkIdType length, int type, int remoteHandle, int tag) override
Performs the actual communication.
 
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
 
int GatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type, int destProcessId) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
int ReceivePartialTagged(void *data, int wordSize, int numWords, int tag, const char *logName)
 
virtual void CloseConnection()
Close a connection.
 
void FixByteOrder(void *data, int wordSize, int numWords)
Fix byte order for received data.
 
int SendTagged(const void *data, int wordSize, int numWords, int tag, const char *logName)
 
void LogTagged(const char *name, const void *data, int wordSize, int numWords, int tag, const char *logName)
 
int ReceivedTaggedFromBuffer(void *data, int wordSize, int numWords, int tag, const char *logName)
 
virtual int WaitForConnection(vtkServerSocket *socket, unsigned long msec=0)
Wait for connection on a given port.
 
int ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, Operation *operation, int destProcessId) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
static int GetVersion()
Uniquely identifies the version of this class.
 
virtual int WaitForConnection(int port)
Wait for connection on a given port.
 
void SetNumberOfProcesses(int num) override
Set the number of processes you will be using.
 
virtual ostream * GetLogStream()
Get/Set the output stream to which communications should be logged.
 
int ScatterVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int type, int srcProcessId) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
int ScatterVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int srcProcessId) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
int CheckForErrorInternal(int id)
 
int ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation, int destProcessId) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
int AllGatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
virtual int LogToFile(const char *name)
Log messages to the given file.
 
~vtkSocketCommunicator() override
 
static vtkSocketCommunicator * New()
 
bool HasBufferredMessages()
Returns true if there are any messages in the receive buffer.
 
int AllGatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
int ReceiveTagged(void *data, int wordSize, int numWords, int tag, const char *logName)
 
void SetSocket(vtkClientSocket *)
Get/Set the actual socket used for communication.
 
virtual void SetLogStream(ostream *stream)
Get/Set the output stream to which communications should be logged.
 
int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, Operation *operation) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
int SwapBytesInReceivedData
 
int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation) override
This class foolishly breaks the conventions of the superclass, so the default implementations of thes...
 
void BufferCurrentMessage()
This flag is cleared before vtkCommand::WrongTagEvent is fired when ever a message with mismatched ta...