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

vtkSharedMemoryCommunicator Class Reference

Provides communication using shared memory. More...

#include <vtkSharedMemoryCommunicator.h>

Inheritance diagram for vtkSharedMemoryCommunicator:

Inheritance graph
[legend]
Collaboration diagram for vtkSharedMemoryCommunicator:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
virtual void PrintSelf (ostream &os, vtkIndent indent)
virtual int Send (int *data, int length, int remoteThreadId, int tag)
virtual int Send (unsigned long *data, int length, int remoteThreadId, int tag)
virtual int Send (char *data, int length, int remoteThreadId, int tag)
virtual int Send (unsigned char *data, int length, int remoteThreadId, int tag)
virtual int Send (float *data, int length, int remoteThreadId, int tag)
virtual int Send (double *data, int length, int remoteThreadId, int tag)
virtual int Send (vtkDataObject *data, int remoteThreadId, int tag)
virtual int Send (vtkDataArray *data, int remoteThreadId, int tag)
virtual int Receive (int *data, int length, int remoteThreadId, int tag)
virtual int Receive (unsigned long *data, int length, int remoteThreadId, int tag)
virtual int Receive (char *data, int length, int remoteThreadId, int tag)
virtual int Receive (unsigned char *data, int length, int remoteThreadId, int tag)
virtual int Receive (float *data, int length, int remoteThreadId, int tag)
virtual int Receive (double *data, int length, int remoteThreadId, int tag)
virtual int Receive (vtkDataObject *data, int remoteThreadId, int tag)
virtual int Receive (vtkDataArray *data, int remoteThreadId, int tag)

Static Public Methods

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

Protected Methods

void Initialize (int nThreads, int forceDeepCopy)
 vtkSharedMemoryCommunicator ()
 ~vtkSharedMemoryCommunicator ()
int Send (vtkDataObject *object, void *data, int dataLength, int remoteThreadId, int tag)
int Receive (vtkDataObject *object, void *data, int dataLength, int remoteThreadId, int tag)
int Send (vtkDataArray *object, int dataLength, int remoteThreadId, int tag)
int Receive (vtkDataArray *object, int dataLength, int remoteThreadId, int tag)
vtkSharedMemoryCommunicatorMessage * NewMessage (vtkDataObject *object, void *data, int dataLength)
vtkSharedMemoryCommunicatorMessage * NewMessage (vtkDataArray *object, void *data, int dataLength)
void DeleteMessage (vtkSharedMemoryCommunicatorMessage *message)
void AddMessage (vtkSharedMemoryCommunicatorMessage *message)
vtkSharedMemoryCommunicatorMessage * FindMessage (int sendId, int tag)
void SignalNewMessage (vtkSharedMemoryCommunicator *receiveCommunicator)
void WaitForNewMessage ()

Protected Attributes

int NumberOfThreads
int Initialized
int LocalThreadId
int WaitingForId
int ForceDeepCopy
vtkSimpleCriticalSectionMessageListLock
vtkSharedMemoryCommunicator ** Communicators
vtkSharedMemoryCommunicator * Parent
vtkSharedMemoryCommunicatorMessage * MessageListStart
vtkSharedMemoryCommunicatorMessage * MessageListEnd
vtkSimpleCriticalSectionGate

Friends

class vtkThreadedController

Detailed Description

Provides communication using shared memory.

Date:
2001/11/13 14:25:58
Revision:
1.10

This class is used together with vtkThreadedController for communication between threads. Once initialized, it creates one communicator per thread. The messages to be sent are copied to the message list of the appropriate communicator by the sending thread and then read by the receiving thread. Mutexes are used to ensure safe access to the data structures. By default, when an object is sent, it is copied with DeepCopy. This behavior can be changed by un-setting ForceDeepCopy.

See also:
vtkCommunicator vtkThreadedController

Definition at line 70 of file vtkSharedMemoryCommunicator.h.


Constructor & Destructor Documentation

vtkSharedMemoryCommunicator::vtkSharedMemoryCommunicator   [protected]
 

vtkSharedMemoryCommunicator::~vtkSharedMemoryCommunicator   [protected]
 


Member Function Documentation

virtual const char* vtkSharedMemoryCommunicator::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 vtkSharedMemoryCommunicator::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 vtkSharedMemoryCommunicator::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.

vtkSharedMemoryCommunicator* vtkSharedMemoryCommunicator::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.

vtkSharedMemoryCommunicator* vtkSharedMemoryCommunicator::New   [static]
 

Creates an empty communicator.

Reimplemented from vtkObject.

virtual void vtkSharedMemoryCommunicator::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 vtkSharedMemoryCommunicator::Send int *    data,
int    length,
int    remoteThreadId,
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.

virtual int vtkSharedMemoryCommunicator::Send unsigned long *    data,
int    length,
int    remoteThreadId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send char *    data,
int    length,
int    remoteThreadId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send unsigned char *    data,
int    length,
int    remoteThreadId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send float *    data,
int    length,
int    remoteThreadId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send double *    data,
int    length,
int    remoteThreadId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send vtkDataObject   data,
int    remoteThreadId,
int    tag
[virtual]
 

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

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send vtkDataArray   data,
int    remoteThreadId,
int    tag
[virtual]
 

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

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive int *    data,
int    length,
int    remoteThreadId,
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.

virtual int vtkSharedMemoryCommunicator::Receive unsigned long *    data,
int    length,
int    remoteThreadId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive char *    data,
int    length,
int    remoteThreadId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive unsigned char *    data,
int    length,
int    remoteThreadId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive float *    data,
int    length,
int    remoteThreadId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive double *    data,
int    length,
int    remoteThreadId,
int    tag
[virtual]
 

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive vtkDataObject   data,
int    remoteThreadId,
int    tag
[virtual]
 

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

Reimplemented from vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive vtkDataArray   data,
int    remoteThreadId,
int    tag
[virtual]
 

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

Reimplemented from vtkCommunicator.

void vtkSharedMemoryCommunicator::Initialize int    nThreads,
int    forceDeepCopy
[protected]
 

int vtkSharedMemoryCommunicator::Send vtkDataObject   object,
void *    data,
int    dataLength,
int    remoteThreadId,
int    tag
[protected]
 

int vtkSharedMemoryCommunicator::Receive vtkDataObject   object,
void *    data,
int    dataLength,
int    remoteThreadId,
int    tag
[protected]
 

int vtkSharedMemoryCommunicator::Send vtkDataArray   object,
int    dataLength,
int    remoteThreadId,
int    tag
[protected]
 

int vtkSharedMemoryCommunicator::Receive vtkDataArray   object,
int    dataLength,
int    remoteThreadId,
int    tag
[protected]
 

vtkSharedMemoryCommunicatorMessage* vtkSharedMemoryCommunicator::NewMessage vtkDataObject   object,
void *    data,
int    dataLength
[protected]
 

vtkSharedMemoryCommunicatorMessage* vtkSharedMemoryCommunicator::NewMessage vtkDataArray   object,
void *    data,
int    dataLength
[protected]
 

void vtkSharedMemoryCommunicator::DeleteMessage vtkSharedMemoryCommunicatorMessage *    message [protected]
 

void vtkSharedMemoryCommunicator::AddMessage vtkSharedMemoryCommunicatorMessage *    message [protected]
 

vtkSharedMemoryCommunicatorMessage* vtkSharedMemoryCommunicator::FindMessage int    sendId,
int    tag
[protected]
 

void vtkSharedMemoryCommunicator::SignalNewMessage vtkSharedMemoryCommunicator *    receiveCommunicator [inline, protected]
 

Definition at line 189 of file vtkSharedMemoryCommunicator.h.

void vtkSharedMemoryCommunicator::WaitForNewMessage   [inline, protected]
 

Definition at line 198 of file vtkSharedMemoryCommunicator.h.


Friends And Related Function Documentation

friend class vtkThreadedController [friend]
 

Definition at line 125 of file vtkSharedMemoryCommunicator.h.


Member Data Documentation

int vtkSharedMemoryCommunicator::NumberOfThreads [protected]
 

Definition at line 131 of file vtkSharedMemoryCommunicator.h.

int vtkSharedMemoryCommunicator::Initialized [protected]
 

Definition at line 132 of file vtkSharedMemoryCommunicator.h.

int vtkSharedMemoryCommunicator::LocalThreadId [protected]
 

Definition at line 135 of file vtkSharedMemoryCommunicator.h.

int vtkSharedMemoryCommunicator::WaitingForId [protected]
 

Definition at line 136 of file vtkSharedMemoryCommunicator.h.

int vtkSharedMemoryCommunicator::ForceDeepCopy [protected]
 

Definition at line 138 of file vtkSharedMemoryCommunicator.h.

vtkSimpleCriticalSection* vtkSharedMemoryCommunicator::MessageListLock [protected]
 

Definition at line 143 of file vtkSharedMemoryCommunicator.h.

vtkSharedMemoryCommunicator** vtkSharedMemoryCommunicator::Communicators [protected]
 

Definition at line 147 of file vtkSharedMemoryCommunicator.h.

vtkSharedMemoryCommunicator* vtkSharedMemoryCommunicator::Parent [protected]
 

Definition at line 149 of file vtkSharedMemoryCommunicator.h.

vtkSharedMemoryCommunicatorMessage* vtkSharedMemoryCommunicator::MessageListStart [protected]
 

Definition at line 152 of file vtkSharedMemoryCommunicator.h.

vtkSharedMemoryCommunicatorMessage* vtkSharedMemoryCommunicator::MessageListEnd [protected]
 

Definition at line 153 of file vtkSharedMemoryCommunicator.h.

vtkSimpleCriticalSection* vtkSharedMemoryCommunicator::Gate [protected]
 

Definition at line 186 of file vtkSharedMemoryCommunicator.h.

Referenced by SignalNewMessage().


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