VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes
vtkSocketController Class Reference

Process communication using Sockets. More...

#include <vtkSocketController.h>

Inheritance diagram for vtkSocketController:
Inheritance graph
[legend]
Collaboration diagram for vtkSocketController:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Consts { ENDIAN_TAG = 1010580540, IDTYPESIZE_TAG = 1027423549, VERSION_TAG = 1044266558, HASH_TAG = 0x3f3f3f3f }
typedef vtkMultiProcessController Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkSocketControllerNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
void SingleMethodExecute ()
void MultipleMethodExecute ()
void CreateOutputWindow ()
virtual int WaitForConnection (int port)
virtual void CloseConnection ()
virtual int ConnectTo (const char *hostName, int port)
int GetSwapBytesInReceivedData ()
void SetCommunicator (vtkSocketCommunicator *comm)
vtkMultiProcessControllerCreateCompliantController ()
virtual void Initialize (int *argc, char ***argv, int)
virtual void Initialize (int *argc, char ***argv)
virtual void Initialize ()
void Finalize ()
void Finalize (int)

Static Public Member Functions

static vtkSocketControllerNew ()
static int IsTypeOf (const char *type)
static vtkSocketControllerSafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkSocketController ()
 ~vtkSocketController ()

Static Protected Attributes

static int Initialized

Detailed Description

Process communication using Sockets.

This is a concrete implementation of vtkMultiProcessController. It supports one-to-one communication using sockets. Note that process 0 will always correspond to self and process 1 to the remote process. This class is best used with ports.

Bug:
Note that because process 0 will always correspond to self, this class breaks assumptions usually implied when using ad-hoc polymorphism. That is, the vtkSocketController will behave differently than other subclasses of vtkMultiProcessController. If you upcast vtkSocketController to vtkMultiProcessController and send it to a method that does not know that the object is actually a vtkSocketController, the object may not behave as intended. For example, if that oblivious class chose to identify a "root" based on the local process id, then both sides of the controller will think they are the root (and that will probably lead to deadlock). If you plan to upcast to vtkMultiProcessController, you should probably use the CreateCompliantController instead.
@sa

vtkMultiProcessController vtkSocketCommunicator vtkInputPort vtkOutputPort

Tests:
vtkSocketController (Tests)

Definition at line 51 of file vtkSocketController.h.


Member Typedef Documentation

Reimplemented from vtkMultiProcessController.

Definition at line 55 of file vtkSocketController.h.


Member Enumeration Documentation

Enumerator:
ENDIAN_TAG 
IDTYPESIZE_TAG 
VERSION_TAG 
HASH_TAG 

Reimplemented from vtkMultiProcessController.

Definition at line 108 of file vtkSocketController.h.


Constructor & Destructor Documentation


Member Function Documentation

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

Reimplemented from vtkObject.

static int vtkSocketController::IsTypeOf ( const char *  name) [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 vtkMultiProcessController.

virtual int vtkSocketController::IsA ( const char *  name) [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 vtkMultiProcessController.

Reimplemented from vtkMultiProcessController.

virtual vtkObjectBase* vtkSocketController::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkMultiProcessController.

Reimplemented from vtkMultiProcessController.

void vtkSocketController::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 vtkMultiProcessController.

virtual void vtkSocketController::Initialize ( int argc,
char ***  argv,
int   
) [inline, virtual]

This method is for initialiazing sockets. One of these is REQUIRED for Windows.

Definition at line 61 of file vtkSocketController.h.

virtual void vtkSocketController::Initialize ( int argc,
char ***  argv 
) [virtual]

This method is for initialiazing sockets. One of these is REQUIRED for Windows.

virtual void vtkSocketController::Initialize ( ) [inline, virtual]

This method is for initialiazing sockets. One of these is REQUIRED for Windows.

Definition at line 64 of file vtkSocketController.h.

void vtkSocketController::Finalize ( ) [inline, virtual]

Does not apply to sockets. Does nothing.

Implements vtkMultiProcessController.

Definition at line 70 of file vtkSocketController.h.

void vtkSocketController::Finalize ( int  ) [inline, virtual]

Does not apply to sockets. Does nothing.

Implements vtkMultiProcessController.

Definition at line 71 of file vtkSocketController.h.

void vtkSocketController::SingleMethodExecute ( ) [inline, virtual]

Does not apply to sockets. Does nothing.

Implements vtkMultiProcessController.

Definition at line 75 of file vtkSocketController.h.

void vtkSocketController::MultipleMethodExecute ( ) [inline, virtual]

Does not apply to sockets. Does nothing.

Implements vtkMultiProcessController.

Definition at line 78 of file vtkSocketController.h.

void vtkSocketController::CreateOutputWindow ( ) [inline, virtual]

Does not apply to sockets. Does nothing.

Implements vtkMultiProcessController.

Definition at line 81 of file vtkSocketController.h.

virtual int vtkSocketController::WaitForConnection ( int  port) [virtual]

Wait for connection on a given port, forwarded to the communicator

virtual void vtkSocketController::CloseConnection ( ) [virtual]

Close a connection, forwarded to the communicator

virtual int vtkSocketController::ConnectTo ( const char *  hostName,
int  port 
) [virtual]

Open a connection to a give machine, forwarded to the communicator

Set the communicator used in normal and rmi communications.

FOOLISH MORTALS! Thou hast forsaken the sacred laws of ad-hoc polymorphism when thou broke a critical assumption of the superclass (namely, each process has thine own id). The time frame to fix thy error has passed. Too much code has come to rely on this abhorrent behavior. Instead, we offer this gift: a method for creating an equivalent communicator with correct process id semantics. The calling code is responsible for deleting this controller.


Member Data Documentation

Definition at line 123 of file vtkSocketController.h.


The documentation for this class was generated from the following file: