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

PsOutgoingSynchronisationMessage Class Reference

this is the abstract class for any sent synchronisation message used on a message passing distributed architecture. More...

#include <PsOutgoingSynchronisationMessage.h>

Inheritance diagram for PsOutgoingSynchronisationMessage:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual ~PsOutgoingSynchronisationMessage ()
 a destructor

 PsOutgoingSynchronisationMessage ()
 a default constructor

virtual const PsDategetMessageDate () const=0
 The timestamp of the outgoing message.

template<typename Type> PsOutgoingSynchronisationMessage & operator<< (const Type &val)
 insert any type for which a pack member function is defined

virtual void pack (const PsPackable &val)
 pack a PsPackable in the message

virtual void pack (bool val)=0
 pack a long in the message

virtual void pack (char val)=0
 pack a long in the message

virtual void pack (long val)=0
 pack a long in the message

virtual void pack (unsigned long val)=0
 pack an unsigned long in the message

virtual void pack (int val)=0
 pack an int in the message

virtual void pack (unsigned int val)=0
 pack an unsigned int in the message

virtual void pack (float val)=0
 pack a float in the message

virtual void pack (double val)=0
 pack a double in the message

virtual void pack (short val)=0
 pack a short in the message

virtual void pack (unsigned short val)=0
 pack an unsigned short in the message

virtual void pack (const string &val)=0
 pack a string in the message

PsOutgoingSynchronisationMessage & operator<< (char *val)
virtual void pack (char *val)=0
 pack a C style string, whithout it's length wich should be pack first if the string isn't if constant length

virtual void pack (const char *val)=0
 pack a C style string, whithout it's length wich should be pack first if the string isn't if constant length

virtual void pack (const long *val, int cnt)=0
 pack a long in the message

virtual void pack (const unsigned long *val, int cnt)=0
 pack an unsigned long in the message

virtual void pack (const int *val, int cnt)=0
 pack an int in the message

virtual void pack (const unsigned int *val, int cnt)=0
 pack an unsigned int in the message

virtual void pack (const float *val, int cnt)=0
 pack a float in the message

virtual void pack (const double *val, int cnt)=0
 pack a double in the message

virtual void pack (const short *val, int cnt)=0
 pack a short in the message

virtual void pack (const unsigned short *val, int cnt)=0
 pack an unsigned short in the message

virtual void pack (long *val, int cnt)=0
 pack a long in the message

virtual void pack (unsigned long *val, int cnt)=0
 pack an unsigned long in the message

virtual void pack (int *val, int cnt)=0
 pack an int in the message

virtual void pack (unsigned int *val, int cnt)=0
 pack an unsigned int in the message

virtual void pack (float *val, int cnt)=0
 pack a float in the message

virtual void pack (double *val, int cnt)=0
 pack a double in the message

virtual void pack (short *val, int cnt)=0
 pack a short in the message

virtual void pack (unsigned short *val, int cnt)=0
 pack an unsigned short in the message

ostrstream & getOutputStream ()
 member function enabling the packing of any flowable : get an output stream.

virtual void packOutputStream ()
 member function enabling the packing of any flowable : pack the outpustream in the message.


Protected Methods

virtual void reinit ()
 reinitialise the ostrstream after use


Protected Attributes

ostrstream _myos
 the ostrstream used to pack data that can only be inserted in a stream


Detailed Description

this is the abstract class for any sent synchronisation message used on a message passing distributed architecture.

should really inherit from ostream for code reuse reason.

Author:
David Margery
Version:
1.0

Definition at line 20 of file PsOutgoingSynchronisationMessage.h.


Constructor & Destructor Documentation

PsOutgoingSynchronisationMessage::~PsOutgoingSynchronisationMessage   [virtual]
 

a destructor

Definition at line 12 of file PsOutgoingSynchronisationMessage.cxx.

00013 {
00014 }

PsOutgoingSynchronisationMessage::PsOutgoingSynchronisationMessage  
 

a default constructor

Definition at line 7 of file PsOutgoingSynchronisationMessage.cxx.

00008 {
00009 }


Member Function Documentation

virtual const PsDate& PsOutgoingSynchronisationMessage::getMessageDate   const [pure virtual]
 

The timestamp of the outgoing message.

Implemented in PsnPvmOutgoingMessage.

Referenced by PsOutput< Type >::pack().

ostrstream & PsOutgoingSynchronisationMessage::getOutputStream  
 

member function enabling the packing of any flowable : get an output stream.

Definition at line 36 of file PsOutgoingSynchronisationMessage.cxx.

References _myos.

Referenced by PsFlowable::pack().

00037 {
00038    _myos.seekp(0, ostrstream::beg);
00039    return _myos ;
00040 }

PsOutgoingSynchronisationMessage & PsOutgoingSynchronisationMessage::operator<< char *    val
 

Definition at line 94 of file PsOutgoingSynchronisationMessage.cxx.

References pack().

00095 {
00096    pack ( val ) ;
00097    return *this ;
00098 }

template<typename Type>
PsOutgoingSynchronisationMessage& PsOutgoingSynchronisationMessage::operator<< const Type &    val [inline]
 

insert any type for which a pack member function is defined

Definition at line 34 of file PsOutgoingSynchronisationMessage.h.

References pack().

00036    {
00037         pack( val ) ;
00038         return *this ;

virtual void PsOutgoingSynchronisationMessage::pack unsigned short *    val,
int    cnt
[pure virtual]
 

pack an unsigned short in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack short *    val,
int    cnt
[pure virtual]
 

pack a short in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack double *    val,
int    cnt
[pure virtual]
 

pack a double in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack float *    val,
int    cnt
[pure virtual]
 

pack a float in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack unsigned int *    val,
int    cnt
[pure virtual]
 

pack an unsigned int in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack int *    val,
int    cnt
[pure virtual]
 

pack an int in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack unsigned long *    val,
int    cnt
[pure virtual]
 

pack an unsigned long in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack long *    val,
int    cnt
[pure virtual]
 

pack a long in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack const unsigned short *    val,
int    cnt
[pure virtual]
 

pack an unsigned short in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack const short *    val,
int    cnt
[pure virtual]
 

pack a short in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack const double *    val,
int    cnt
[pure virtual]
 

pack a double in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack const float *    val,
int    cnt
[pure virtual]
 

pack a float in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack const unsigned int *    val,
int    cnt
[pure virtual]
 

pack an unsigned int in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack const int *    val,
int    cnt
[pure virtual]
 

pack an int in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack const unsigned long *    val,
int    cnt
[pure virtual]
 

pack an unsigned long in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack const long *    val,
int    cnt
[pure virtual]
 

pack a long in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack const char *    val [pure virtual]
 

pack a C style string, whithout it's length wich should be pack first if the string isn't if constant length

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack char *    val [pure virtual]
 

pack a C style string, whithout it's length wich should be pack first if the string isn't if constant length

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack const string &    val [pure virtual]
 

pack a string in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack unsigned short    val [pure virtual]
 

pack an unsigned short in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack short    val [pure virtual]
 

pack a short in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack double    val [pure virtual]
 

pack a double in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack float    val [pure virtual]
 

pack a float in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack unsigned int    val [pure virtual]
 

pack an unsigned int in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack int    val [pure virtual]
 

pack an int in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack unsigned long    val [pure virtual]
 

pack an unsigned long in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack long    val [pure virtual]
 

pack a long in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack char    val [pure virtual]
 

pack a long in the message

Implemented in PsnPvmOutgoingMessage.

virtual void PsOutgoingSynchronisationMessage::pack bool    val [pure virtual]
 

pack a long in the message

Implemented in PsnPvmOutgoingMessage.

void PsOutgoingSynchronisationMessage::pack const PsPackable   val [virtual]
 

pack a PsPackable in the message

Definition at line 78 of file PsOutgoingSynchronisationMessage.cxx.

References PsPackable::pack().

Referenced by operator<<(), and packOutputStream().

00079 {
00080 #ifdef _DEBUGPVMMESS
00081    cerr<<"PsOutgoingSynchronisationMessage:"
00082        <<this
00083        <<":pack(const PsPackable  & ("
00084        <<typeid (val).name()
00085        <<") val)";
00086 #endif
00087    val.pack ( *this ) ;
00088 #ifdef _DEBUGPVMMESS
00089    cerr<< "end"<<endl;
00090 #endif
00091 }

void PsOutgoingSynchronisationMessage::packOutputStream   [virtual]
 

member function enabling the packing of any flowable : pack the outpustream in the message.

pack all the data associated inserted into the ostsstream into the active buffer

Definition at line 43 of file PsOutgoingSynchronisationMessage.cxx.

References _myos, and pack().

Referenced by PsFlowable::pack().

00044 {
00045 #ifdef _DEBUGPVMMESS
00046   cerr<<"PsOutgoingSynchronisationMessage:"<<(void *)this<<":packOutputMessage () "<<endl;
00047 #endif
00048   
00049 #ifdef _USESSTREAM
00050 
00051   pack ( _myos.str() ) ;
00052   
00053   _myos.seekp(0, ostringstream::beg) ;
00054 
00055 #else
00056   _myos.freeze( 1 ) ;
00057   
00058   int messageSize = _myos.pcount () ;
00059   char * messageToPack = _myos.str() ;
00060 
00061   assert ( messageToPack[messageSize - 1] == 0 ) ;
00062   
00063   // int ind = myos->tellp();
00064   // mess[ind] = '\0' ;
00065 
00066   pack ( messageSize ) ;
00067   pack ( messageToPack ) ;
00068 
00069   _myos.freeze( 0 ) ;
00070 
00071   // prepare the associated stream for new insertions
00072   //myos->rdbuf()->seekpos (ios::out, ostrstream::beg) ;
00073   _myos.seekp(0, ostrstream::beg) ;
00074 #endif
00075 }

void PsOutgoingSynchronisationMessage::reinit   [protected, virtual]
 

reinitialise the ostrstream after use

Definition at line 17 of file PsOutgoingSynchronisationMessage.cxx.

References _myos.

Referenced by PsnPvmOutgoingMessage::reinitAndRevertPvmContext().

00018 {
00019    // prepare the associated stream for new insertions
00020    //myos->rdbuf()->seekpos (ios::out, ostrstream::beg) ;
00021 #ifdef _USESSTREAM
00022    _myos.seekp (ios::out, ostringstream::beg) ;
00023 #else
00024    _myos.seekp(0,ostrstream::beg) ;
00025 #endif  
00026 }


Member Data Documentation

ostrstream PsOutgoingSynchronisationMessage::_myos [protected]
 

the ostrstream used to pack data that can only be inserted in a stream

Definition at line 147 of file PsOutgoingSynchronisationMessage.h.

Referenced by getOutputStream(), packOutputStream(), and reinit().


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

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

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