IBR-DTNSuite  0.8
dtn::data::PayloadBlock Class Reference

#include <PayloadBlock.h>

Inheritance diagram for dtn::data::PayloadBlock:
Collaboration diagram for dtn::data::PayloadBlock:

List of all members.

Public Member Functions

 PayloadBlock ()
 PayloadBlock (ibrcommon::BLOB::Reference ref)
virtual ~PayloadBlock ()
ibrcommon::BLOB::Reference getBLOB () const
virtual size_t getLength () const
virtual std::ostream & serialize (std::ostream &stream, size_t &length) const
virtual std::istream & deserialize (std::istream &stream, const size_t length)
std::ostream & serialize (std::ostream &stream, size_t clip_offset, size_t clip_length) const

Static Public Attributes

static const char BLOCK_TYPE = 1

Detailed Description

Definition at line 20 of file PayloadBlock.h.


Constructor & Destructor Documentation

Definition at line 27 of file PayloadBlock.cpp.


Member Function Documentation

std::istream & dtn::data::PayloadBlock::deserialize ( std::istream &  stream,
const size_t  length 
) [virtual]

Deserialize the derived block payload.

Parameters:
streamA input stream to deserialize from.
Returns:
The same reference as given with the stream parameter.

Implements dtn::data::Block.

Definition at line 73 of file PayloadBlock.cpp.

References ibrcommon::BLOB::iostream::clear(), ibrcommon::BLOB::copy(), dtn::data::Block::FORWARDED_WITHOUT_PROCESSED, ibrcommon::BLOB::Reference::iostream(), and ibrcommon::Exception::what().

Here is the call graph for this function:

size_t dtn::data::PayloadBlock::getLength ( ) const [virtual]

Return the length of the payload, if this were an abstract block. It is the length put in the third field, after block type and processing flags.

Implements dtn::data::Block.

Definition at line 36 of file PayloadBlock.cpp.

References ibrcommon::BLOB::Reference::iostream(), and ibrcommon::BLOB::iostream::size().

Referenced by dtn::data::CompressedPayloadBlock::compress(), dtn::data::MetaBundle::MetaBundle(), dtn::data::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::DefaultDeserializer::operator>>(), dtn::data::DefaultSerializer::serialize(), and dtn::storage::SQLiteDatabase::store().

Here is the call graph for this function:

std::ostream & dtn::data::PayloadBlock::serialize ( std::ostream &  stream,
size_t &  length 
) const [virtual]

Serialize the derived block payload.

Parameters:
streamA output stream to serialize into.
Returns:
The same reference as given with the stream parameter.

Implements dtn::data::Block.

Definition at line 43 of file PayloadBlock.cpp.

References ibrcommon::BLOB::copy(), ibrcommon::BLOB::Reference::iostream(), ibrcommon::BLOB::iostream::size(), and ibrcommon::Exception::what().

Referenced by dtn::data::DefaultSerializer::serialize().

Here is the call graph for this function:

std::ostream & dtn::data::PayloadBlock::serialize ( std::ostream &  stream,
size_t  clip_offset,
size_t  clip_length 
) const

serialize only a part of the payload

Parameters:
streamThe stream to serialize to.
clip_offsetThe data offset of the payload.
clip_lengthThe length of the data.
Returns:
The previously given stream.

Definition at line 58 of file PayloadBlock.cpp.

References ibrcommon::BLOB::copy(), ibrcommon::BLOB::Reference::iostream(), and ibrcommon::Exception::what().

Here is the call graph for this function:


Member Data Documentation


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