[Cppunit-cvs] cppunit2/src/opentest serializer.cpp,1.2,1.3
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-06-30 21:49:35
|
Update of /cvsroot/cppunit/cppunit2/src/opentest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14791/src/opentest Modified Files: serializer.cpp Log Message: * RemoteMessage data are interleaved with Packets. Index: serializer.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/opentest/serializer.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** serializer.cpp 26 Jun 2005 19:41:15 -0000 1.2 --- serializer.cpp 30 Jun 2005 21:49:26 -0000 1.3 *************** *** 2,6 **** #include <float.h> // For struct assertion_traits<double> #include <stdio.h> ! namespace OpenTest { --- 2,9 ---- #include <float.h> // For struct assertion_traits<double> #include <stdio.h> ! ! // @todo Packets : should assumes packets end at the end of the current message when reading... ! ! namespace OpenTest { *************** *** 100,103 **** --- 103,138 ---- + bool + Packets::hasPendingMessage() const + { + return !messages_.empty(); + } + + + Packets::Pos + Packets::getFirstMessageLength() + { + CPPTL_ASSERT_MESSAGE( !messages_.empty(), "No message available" ); + CPPTL_ASSERT_MESSAGE( messages_.front().length_ != 0, "Message not completly serialized." ); + return messages_.front().length_; + } + + + void + Packets::discardFirstMessage() + { + Packet *current = packetsHead_; + while ( current != externalPos_.packet_ ) + { + Packet *toDelete = current; + current = current->next_; + CPPTL_ASSERT_MESSAGE( toDelete != serializePos_.packet_, + "Deleting packets used for serialization." ); + delete toDelete; + } + packetsHead_ = current; + } + + unsigned char Packets::serializationReadNextByte() |