OMK::PvmMulticastMessage Class Reference

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

#include <OMKPvmMulticastMessage.h>

Inheritance diagram for OMK::PvmMulticastMessage:

Inheritance graph
[legend]
Collaboration diagram for OMK::PvmMulticastMessage:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~PvmMulticastMessage ()
 destructor
 PvmMulticastMessage (const std::vector< int > &)
 constructor specifying the distant site IDs to which message will be sent
virtual void send (PvmMessage::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 15 of file OMKPvmMulticastMessage.h.


Constructor & Destructor Documentation

PvmMulticastMessage::~PvmMulticastMessage (  )  [virtual]

destructor

Definition at line 22 of file OMKPvmMulticastMessage.cxx.

References _recepients.

00023 {
00024   assert (_recepients != NULL ) ;
00025   delete [] _recepients ;
00026 }

PvmMulticastMessage::PvmMulticastMessage ( const std::vector< int > &   ) 

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

Definition at line 11 of file OMKPvmMulticastMessage.cxx.

References _numberOfRecepients, and _recepients.

00011                                                                             :
00012   _numberOfRecepients ( recepients.size () ),
00013   _recepients ( 0 ) 
00014 {
00015   _recepients = new int [ _numberOfRecepients ] ;
00016   for ( int i = 0 ; i < _numberOfRecepients ; ++i )
00017     {
00018       _recepients [i] = recepients [i] ;
00019     }
00020 }


Member Function Documentation

void PvmMulticastMessage::send ( PvmMessage::MessageTag  tag  )  [virtual]

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

Implements OMK::PvmOutgoingMessage.

Definition at line 28 of file OMKPvmMulticastMessage.cxx.

References OMK::PvmMessage::_currentBuffer, _numberOfRecepients, _recepients, OMK::PvmOutgoingMessage::checkForSendErrors(), and OMK::PvmOutgoingMessage::reinitAndRevertPvmContext().

Referenced by OMK::Svm::addNewSiteToSimulation(), OMK::Svm::createDistributedSimulation(), and OMK::Svm::disconnectFromDistributedSimulation().

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


Member Data Documentation

int OMK::PvmMulticastMessage::_numberOfRecepients [protected]

the number of recepients

Definition at line 29 of file OMKPvmMulticastMessage.h.

Referenced by PvmMulticastMessage(), and send().

int* OMK::PvmMulticastMessage::_recepients [protected]

array of recepients ids

Definition at line 32 of file OMKPvmMulticastMessage.h.

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


logo OpenMask

Documentation generated on Mon Jun 9 11:46:03 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007