Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PsnPvmMulticastMessage Class Reference

class refining the pvm outgoing message for a send with any number of recipients More...

#include <PsnPvmMulticastMessage.h>

Inheritance diagram for PsnPvmMulticastMessage:

Inheritance graph
[legend]
Collaboration diagram for PsnPvmMulticastMessage:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual ~PsnPvmMulticastMessage ()
 destructor

 PsnPvmMulticastMessage (const vector< int > &)
 constructor specifying the distant site IDs to which message will be sent

virtual void send (PsnPvmMessage::MessageTag tag)
 send all previously packed data to all destinations and reinitiliases the send buffer


Protected Attributes

int _numberOfRecepients
 the number of recepients

int * _recepients
 array of recepients ids


Detailed Description

class refining the pvm outgoing message for a send with any number of recipients

Author:
D. Margery
Version:
1.0

Definition at line 13 of file PsnPvmMulticastMessage.h.


Constructor & Destructor Documentation

PsnPvmMulticastMessage::~PsnPvmMulticastMessage   [virtual]
 

destructor

Definition at line 19 of file PsnPvmMulticastMessage.cxx.

References _recepients.

00020 {
00021   assert (_recepients != NULL ) ;
00022   delete [] _recepients ;
00023 }

PsnPvmMulticastMessage::PsnPvmMulticastMessage const vector< int > &   
 

constructor specifying the distant site IDs to which message will be sent

Definition at line 6 of file PsnPvmMulticastMessage.cxx.

References _numberOfRecepients, and _recepients.

00006                                                                                :
00007   _numberOfRecepients ( recepients.size () ),
00008   _recepients ( 0 ) 
00009 {
00010   _recepients = new int [ _numberOfRecepients ] ;
00011   for ( int i = 0 ; i < _numberOfRecepients ; ++i )
00012     {
00013       _recepients [i] = recepients [i] ;
00014     }
00015 }


Member Function Documentation

void PsnPvmMulticastMessage::send PsnPvmMessage::MessageTag    tag [virtual]
 

send all previously packed data to all destinations and reinitiliases the send buffer

Implements PsnPvmOutgoingMessage.

Definition at line 27 of file PsnPvmMulticastMessage.cxx.

References PsnPvmMessage::_currentBuffer, _numberOfRecepients, _recepients, PsnPvmOutgoingMessage::checkForSendErrors(), PsnPvmMessage::MessageTag, and PsnPvmOutgoingMessage::reinitAndRevertPvmContext().

Referenced by PsnSvm::createDistributedSimulation(), and PsnSvm::disconnectFromDistributedSimulation().

00028 {
00029 #ifdef _DEBUGPVMMESS
00030    cerr<<"PsnPvmMulticastMessage:"<<(void *)this<<": send("<<tag<<")"<<endl; 
00031 #endif
00032   int oldbuf = pvm_setsbuf ( _currentBuffer ) ;
00033 
00034   int info = pvm_mcast ( _recepients, _numberOfRecepients, tag ) ;
00035 
00036   checkForSendErrors ( info ) ;
00037 
00038   reinitAndRevertPvmContext ( oldbuf ) ;
00039 }


Member Data Documentation

int PsnPvmMulticastMessage::_numberOfRecepients [protected]
 

the number of recepients

Definition at line 27 of file PsnPvmMulticastMessage.h.

Referenced by PsnPvmMulticastMessage(), and send().

int* PsnPvmMulticastMessage::_recepients [protected]
 

array of recepients ids

Definition at line 30 of file PsnPvmMulticastMessage.h.

Referenced by PsnPvmMulticastMessage(), send(), and ~PsnPvmMulticastMessage().


The documentation for this class was generated from the following files:
logo OpenMask

Documentation generated on Mon Nov 25 15:26:22 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001