00001 #include "PsIncomingSynchronisationMessage.h" 00002 00003 #include "PsPackable.h" 00004 #include "assert.h" 00005 #include <typeinfo> 00006 00007 PsIncomingSynchronisationMessage::PsIncomingSynchronisationMessage() : 00008 _myis ( 0 ) 00009 { 00010 } 00011 00012 00013 PsIncomingSynchronisationMessage::~PsIncomingSynchronisationMessage() 00014 { 00015 if ( _myis != NULL ) delete _myis ; 00016 } 00017 00018 00019 00020 #ifdef _USESSTREAM 00021 istringstream & PsIncomingSynchronisationMessage::getInputStream () 00022 #else 00023 istrstream & PsIncomingSynchronisationMessage::getInputStream () 00024 #endif 00025 { 00026 assert ( _myis != NULL ) ; 00027 return *_myis ; 00028 } 00029 00030 00031 00032 void PsIncomingSynchronisationMessage::unpackInputStream ( ) 00033 { 00034 if ( _myis != NULL ) delete _myis ; 00035 00036 #ifdef _USESSTREAM 00037 string inputStream ; 00038 get ( inputStream ) ; 00039 _myis = new istringstream ( inputStream ) ; 00040 #else 00041 00042 int messageLength ; 00043 00044 get ( messageLength ) ; 00045 00046 char * message = new char [messageLength] ; 00047 00048 get ( message ) ; 00049 00050 assert (message [messageLength -1] == 0 ) ; 00051 00052 _myis = new istrstream (message, messageLength) ; 00053 #endif 00054 } 00055 00056 00057 00058 PsIncomingSynchronisationMessage & PsIncomingSynchronisationMessage::operator >> (char * val) 00059 { 00060 get ( val ) ; 00061 return *this ; 00062 } 00063 00064 00065 void PsIncomingSynchronisationMessage::get (PsPackable & val) 00066 { 00067 val.unpack(*this) ; 00068 }
| Documentation generated on Mon Nov 25 15:24:59 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |