Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

vtkSocketCommunicator Class Reference

Process communication using Sockets. More...

#include <vtkSocketCommunicator.h>

Inheritance diagram for vtkSocketCommunicator:

Inheritance graph
[legend]
Collaboration diagram for vtkSocketCommunicator:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual int WaitForConnection (int port)
virtual void CloseConnection ()
virtual int ConnectTo (char *hostName, int port)
int Send (int *data, int length, int remoteProcessId, int tag)
int Send (unsigned long *data, int length, int remoteProcessId, int tag)
int Send (char *data, int length, int remoteProcessId, int tag)
int Send (unsigned char *data, int length, int remoteProcessId, int tag)
int Send (float *data, int length, int remoteProcessId, int tag)
int Send (double *data, int length, int remoteProcessId, int tag)
int Send (vtkDataObject *data, int remoteId, int tag)
int Send (vtkDataArray *data, int remoteId, int tag)
int Receive (int *data, int length, int remoteProcessId, int tag)
int Receive (unsigned long *data, int length, int remoteProcessId, int tag)
int Receive (char *data, int length, int remoteProcessId, int tag)
int Receive (unsigned char *data, int length, int remoteProcessId, int tag)
int Receive (float *data, int length, int remoteProcessId, int tag)
int Receive (double *data, int length, int remoteProcessId, int tag)
int Receive (vtkDataObject *data, int remoteId, int tag)
int Receive (vtkDataArray *data, int remoteId, int tag)
virtual int GetSwapBytesInReceivedData ()
virtual int GetIsConnected ()

Static Public Methods

vtkSocketCommunicator * New ()
int IsTypeOf (const char *type)
vtkSocketCommunicator * SafeDownCast (vtkObject *o)

Protected Methods

 vtkSocketCommunicator ()
 ~vtkSocketCommunicator ()
int ReceiveMessage (char *data, int size, int length, int tag)

Protected Attributes

int Socket
int IsConnected
int NumberOfProcesses
int SwapBytesInReceivedData

Detailed Description

Process communication using Sockets.

Date:
2001/11/02 16:43:02
Revision:
1.18

This is a concrete implementation of vtkCommunicator which supports interprocess communication using BSD style sockets. It supports byte swapping for the communication of machines with different endianness.

Warning:
Communication between 32 bit and 64 bit systems is not fully supported. If a type does not have the same length on both systems, this communicator can not be used to transfer data of that type.
See also:
vtkCommunicator vtkSharedMemoryCommunicator vtkSocketController
Tests:
vtkSocketCommunicator (Tests)

Definition at line 93 of file vtkSocketCommunicator.h.


Constructor & Destructor Documentation

vtkSocketCommunicator::vtkSocketCommunicator   [protected]
 

vtkSocketCommunicator::~vtkSocketCommunicator   [protected]
 


Member Function Documentation

vtkSocketCommunicator* vtkSocketCommunicator::New   [static]
 

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

virtual const char* vtkSocketCommunicator::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::IsTypeOf const char *    type [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkCommunicator.

virtual int vtkSocketCommunicator::IsA const char *    type [virtual]
 

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkCommunicator.

vtkSocketCommunicator* vtkSocketCommunicator::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkCommunicator.

Referenced by vtkSocketController::CloseConnection(), vtkSocketController::ConnectTo(), vtkSocketController::GetSwapBytesInReceivedData(), and vtkSocketController::WaitForConnection().

void vtkSocketCommunicator::PrintSelf ostream &    os,
vtkIndent    indent
[virtual]
 

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkCommunicator.

virtual int vtkSocketCommunicator::WaitForConnection int    port [virtual]
 

Wait for connection on a given port.

virtual void vtkSocketCommunicator::CloseConnection   [virtual]
 

Close a connection.

virtual int vtkSocketCommunicator::ConnectTo char *    hostName,
int    port
[virtual]
 

Open a connection to host.

virtual int vtkSocketCommunicator::GetSwapBytesInReceivedData   [virtual]
 

Returns 1 if bytes must be swapped in received ints, floats, etc

virtual int vtkSocketCommunicator::GetIsConnected   [virtual]
 

Is the communicator connected?.

int vtkSocketCommunicator::Send int *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

This method sends data to another process. Tag eliminates ambiguity when multiple sends or receives exist in the same process.

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Send unsigned long *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Send char *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Send unsigned char *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Send float *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Send double *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Send vtkDataObject   data,
int    remoteId,
int    tag
[inline, virtual]
 

This method sends a data object to a destination. Tag eliminates ambiguity and is used to match sends to receives.

Reimplemented from vtkCommunicator.

Definition at line 134 of file vtkSocketCommunicator.h.

int vtkSocketCommunicator::Send vtkDataArray   data,
int    remoteId,
int    tag
[inline, virtual]
 

This method sends a data array to a destination. Tag eliminates ambiguity and is used to match sends to receives.

Reimplemented from vtkCommunicator.

Definition at line 136 of file vtkSocketCommunicator.h.

int vtkSocketCommunicator::Receive int *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

This method receives data from a corresponding send. It blocks until the receive is finished. It calls methods in "data" to communicate the sending data.

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Receive unsigned long *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Receive char *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Receive unsigned char *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Receive float *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Receive double *    data,
int    length,
int    remoteProcessId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

int vtkSocketCommunicator::Receive vtkDataObject   data,
int    remoteId,
int    tag
[inline, virtual]
 

This method receives a data object from a corresponding send. It blocks until the receive is finished.

Reimplemented from vtkCommunicator.

Definition at line 153 of file vtkSocketCommunicator.h.

int vtkSocketCommunicator::Receive vtkDataArray   data,
int    remoteId,
int    tag
[inline, virtual]
 

This method receives a data array from a corresponding send. It blocks until the receive is finished.

Reimplemented from vtkCommunicator.

Definition at line 155 of file vtkSocketCommunicator.h.

int vtkSocketCommunicator::ReceiveMessage char *    data,
int    size,
int    length,
int    tag
[protected]
 


Member Data Documentation

int vtkSocketCommunicator::Socket [protected]
 

Definition at line 160 of file vtkSocketCommunicator.h.

int vtkSocketCommunicator::IsConnected [protected]
 

Definition at line 161 of file vtkSocketCommunicator.h.

int vtkSocketCommunicator::NumberOfProcesses [protected]
 

Definition at line 162 of file vtkSocketCommunicator.h.

int vtkSocketCommunicator::SwapBytesInReceivedData [protected]
 

Definition at line 163 of file vtkSocketCommunicator.h.


The documentation for this class was generated from the following file:
Generated on Thu Mar 28 14:42:42 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001