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

# vtkSharedMemoryCommunicator Class Reference

`#include <vtkSharedMemoryCommunicator.h>`

Inheritance diagram for vtkSharedMemoryCommunicator:

[legend]
Collaboration diagram for vtkSharedMemoryCommunicator:

[legend]
List of all members.

## Detailed Description

Provides communication using shared memory.

Date:
  2002/08/12 15:20:30

Revision:
  1.14

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

Created by:
  - Martin, Ken

CVS contributions (if > 5%):
  - Martin, Ken (63%)
  - Geveci, Berk (22%)
  - Cedilnik, Andy (6%)

CVS logs (CVSweb):
  - .`h` (`/Parallel/vtkSharedMemoryCommunicator.h)`
  - .`cxx` (`/Parallel/vtkSharedMemoryCommunicator.cxx)`

Definition at line 57 of file vtkSharedMemoryCommunicator.h.

## [NOHEADER]
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)
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 ()
int | NumberOfThreads
int | Initialized
int | LocalThreadId
int | WaitingForId
int | ForceDeepCopy
vtkSimpleCriticalSection * | MessageListLock
vtkSharedMemoryCommunicator ** | Communicators
vtkSharedMemoryCommunicator * | Parent
vtkSharedMemoryCommunicatorMessage * | MessageListStart
vtkSharedMemoryCommunicatorMessage * | MessageListEnd
vtkSimpleCriticalSection * | Gate
class | vtkThreadedController
## Public Types
typedef vtkCommunicator | Superclass
## 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)
## Static Public Methods
int | IsTypeOf (const char *type)
vtkSharedMemoryCommunicator * | SafeDownCast (vtkObject *o)
vtkSharedMemoryCommunicator * | New ()

## Member Typedef Documentation

typedef vtkCommunicator vtkSharedMemoryCommunicator::Superclass

| Reimplemented from vtkCommunicator. Definition at line 60 of file vtkSharedMemoryCommunicator.h.

## Constructor & Destructor Documentation

vtkSharedMemoryCommunicator::vtkSharedMemoryCommunicator | ( |  | ) | `[protected]`

| 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.

vtkSharedMemoryCommunicator::~vtkSharedMemoryCommunicator | ( |  | ) | `[protected]`

| 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.

## Member Function Documentation

virtual const char* vtkSharedMemoryCommunicator::GetClassName | ( |  | ) | `[virtual]`

| 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 vtkTypeRevisionMacro 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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkCommunicator.

vtkSharedMemoryCommunicator* vtkSharedMemoryCommunicator::SafeDownCast | ( | vtkObject * | o | ) | `[static]`

| 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send | ( | unsigned long * | 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send | ( | char * | 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send | ( | unsigned char * | 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send | ( | float * | 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send | ( | double * | 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Send | ( | vtkDataObject * | data,
|  | 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 | ( | vtkDataArray * | data,
|  | 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::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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive | ( | unsigned long * | 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive | ( | char * | 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive | ( | unsigned char * | 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive | ( | float * | 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive | ( | double * | 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. Implements vtkCommunicator.

virtual int vtkSharedMemoryCommunicator::Receive | ( | vtkDataObject * | data,
|  | 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 | ( | vtkDataArray * | data,
|  | 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.

void vtkSharedMemoryCommunicator::Initialize | ( | int | nThreads,
|  | int | forceDeepCopy
| ) | `[protected]`

| 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.

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

| 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.

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

| 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.

int vtkSharedMemoryCommunicator::Send | ( | vtkDataArray * | object,
|  | int | dataLength,
|  | int | remoteThreadId,
|  | int | tag
| ) | `[protected]`

| 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.

int vtkSharedMemoryCommunicator::Receive | ( | vtkDataArray * | object,
|  | int | dataLength,
|  | int | remoteThreadId,
|  | int | tag
| ) | `[protected]`

| 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.

vtkSharedMemoryCommunicatorMessage* vtkSharedMemoryCommunicator::NewMessage | ( | vtkDataObject * | object,
|  | void * | data,
|  | int | dataLength
| ) | `[protected]`

| 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.

vtkSharedMemoryCommunicatorMessage* vtkSharedMemoryCommunicator::NewMessage | ( | vtkDataArray * | object,
|  | void * | data,
|  | int | dataLength
| ) | `[protected]`

| 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.

void vtkSharedMemoryCommunicator::DeleteMessage | ( | vtkSharedMemoryCommunicatorMessage * | message | ) | `[protected]`

| 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.

void vtkSharedMemoryCommunicator::AddMessage | ( | vtkSharedMemoryCommunicatorMessage * | message | ) | `[protected]`

| 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.

vtkSharedMemoryCommunicatorMessage* vtkSharedMemoryCommunicator::FindMessage | ( | int | sendId,
|  | int | tag
| ) | `[protected]`

| 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.

void vtkSharedMemoryCommunicator::SignalNewMessage | ( | vtkSharedMemoryCommunicator * | receiveCommunicator | ) | `[protected]`

| 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.

void vtkSharedMemoryCommunicator::WaitForNewMessage | ( |  | ) | `[protected]`

| 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.

## Friends And Related Function Documentation

friend class vtkThreadedController`[friend]`

| 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. Definition at line 110 of file vtkSharedMemoryCommunicator.h.

## Member Data Documentation

int vtkSharedMemoryCommunicator::NumberOfThreads`[protected]`

| 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. Definition at line 116 of file vtkSharedMemoryCommunicator.h.

int vtkSharedMemoryCommunicator::Initialized`[protected]`

| 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. Definition at line 117 of file vtkSharedMemoryCommunicator.h.

int vtkSharedMemoryCommunicator::LocalThreadId`[protected]`

| 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. Definition at line 120 of file vtkSharedMemoryCommunicator.h.

int vtkSharedMemoryCommunicator::WaitingForId`[protected]`

| 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. Definition at line 121 of file vtkSharedMemoryCommunicator.h.

int vtkSharedMemoryCommunicator::ForceDeepCopy`[protected]`

| 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. Definition at line 123 of file vtkSharedMemoryCommunicator.h.

vtkSimpleCriticalSection* vtkSharedMemoryCommunicator::MessageListLock`[protected]`

| 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. Definition at line 128 of file vtkSharedMemoryCommunicator.h.

vtkSharedMemoryCommunicator** vtkSharedMemoryCommunicator::Communicators`[protected]`

| 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. Definition at line 132 of file vtkSharedMemoryCommunicator.h.

vtkSharedMemoryCommunicator* vtkSharedMemoryCommunicator::Parent`[protected]`

| 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. Definition at line 134 of file vtkSharedMemoryCommunicator.h.

vtkSharedMemoryCommunicatorMessage* vtkSharedMemoryCommunicator::MessageListStart`[protected]`

| 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. Definition at line 137 of file vtkSharedMemoryCommunicator.h.

vtkSharedMemoryCommunicatorMessage* vtkSharedMemoryCommunicator::MessageListEnd`[protected]`

| 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. Definition at line 138 of file vtkSharedMemoryCommunicator.h.

vtkSimpleCriticalSection* vtkSharedMemoryCommunicator::Gate`[protected]`

| 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. Definition at line 171 of file vtkSharedMemoryCommunicator.h.

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

- Parallel/vtkSharedMemoryCommunicator.h