IBR-DTNSuite
0.8
|
#include <PayloadBlock.h>
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 |
Definition at line 20 of file PayloadBlock.h.
Definition at line 17 of file PayloadBlock.cpp.
Definition at line 22 of file PayloadBlock.cpp.
dtn::data::PayloadBlock::~PayloadBlock | ( | ) | [virtual] |
Definition at line 27 of file PayloadBlock.cpp.
std::istream & dtn::data::PayloadBlock::deserialize | ( | std::istream & | stream, |
const size_t | length | ||
) | [virtual] |
Deserialize the derived block payload.
stream | A input stream to deserialize from. |
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().
Definition at line 31 of file PayloadBlock.cpp.
Referenced by dtn::daemon::CapsuleWorker::callbackBundleReceived(), dtn::daemon::EchoWorker::callbackBundleReceived(), dtn::daemon::DTNTPWorker::callbackBundleReceived(), dtn::data::CompressedPayloadBlock::compress(), dtn::utils::Utils::decapsule(), dtn::utils::Utils::encapsule(), dtn::security::PayloadConfidentialBlock::encrypt(), dtn::api::Bundle::getData(), main(), dtn::data::operator<<(), dtn::routing::NodeHandshakeExtension::processHandshake(), dtn::security::PayloadIntegrityBlock::sign(), dtn::storage::SQLiteBundleStorage::store(), and dtn::api::BundleStreamBuf::underflow().
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().
std::ostream & dtn::data::PayloadBlock::serialize | ( | std::ostream & | stream, |
size_t & | length | ||
) | const [virtual] |
Serialize the derived block payload.
stream | A output stream to serialize into. |
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().
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
stream | The stream to serialize to. |
clip_offset | The data offset of the payload. |
clip_length | The length of the data. |
Definition at line 58 of file PayloadBlock.cpp.
References ibrcommon::BLOB::copy(), ibrcommon::BLOB::Reference::iostream(), and ibrcommon::Exception::what().
const char dtn::data::PayloadBlock::BLOCK_TYPE = 1 [static] |
Definition at line 23 of file PayloadBlock.h.
Referenced by dtn::security::SecurityBlock::decryptBlock(), dtn::storage::SQLiteBundleStorage::get(), dtn::data::Bundle::BlockList::get(), dtn::security::MutualSerializer::operator<<(), dtn::data::DefaultDeserializer::operator>>(), dtn::api::PlainDeserializer::readBlock(), and dtn::data::SeparateDeserializer::readBlock().