IBR-DTNSuite
0.12
|
#include <PayloadBlock.h>
Public Member Functions | |
PayloadBlock () | |
PayloadBlock (ibrcommon::BLOB::Reference ref) | |
virtual | ~PayloadBlock () |
ibrcommon::BLOB::Reference | getBLOB () const |
virtual Length | getLength () const |
virtual std::ostream & | serialize (std::ostream &stream, Length &length) const |
virtual std::istream & | deserialize (std::istream &stream, const Length &length) |
std::ostream & | serialize (std::ostream &stream, const Length &clip_offset, const Length &clip_length) const |
Public Member Functions inherited from dtn::data::Block | |
virtual | ~Block () |
Block & | operator= (const Block &block) |
bool | operator== (const block_t &id) const |
virtual void | addEID (const dtn::data::EID &eid) |
virtual void | clearEIDs () |
virtual const eid_list & | getEIDList () const |
const block_t & | getType () const |
void | set (ProcFlags flag, const bool &value) |
bool | get (ProcFlags flag) const |
const Bitset< ProcFlags > & | getProcessingFlags () const |
virtual Length | getLength_strict () const |
virtual std::ostream & | serialize_strict (std::ostream &stream, Length &length) const |
Static Public Attributes | |
static const dtn::data::block_t | BLOCK_TYPE = 1 |
Additional Inherited Members | |
Public Types inherited from dtn::data::Block | |
enum | ProcFlags { REPLICATE_IN_EVERY_FRAGMENT = 1, TRANSMIT_STATUSREPORT_IF_NOT_PROCESSED = 1 << 0x01, DELETE_BUNDLE_IF_NOT_PROCESSED = 1 << 0x02, LAST_BLOCK = 1 << 0x03, DISCARD_IF_NOT_PROCESSED = 1 << 0x04, FORWARDED_WITHOUT_PROCESSED = 1 << 0x05, BLOCK_CONTAINS_EIDS = 1 << 0x06 } |
typedef std::list< dtn::data::EID > | eid_list |
Protected Member Functions inherited from dtn::data::Block | |
Block (block_t blocktype) | |
Protected Attributes inherited from dtn::data::Block | |
block_t | _blocktype |
eid_list | _eids |
Definition at line 35 of file PayloadBlock.h.
dtn::data::PayloadBlock::PayloadBlock | ( | ) |
Definition at line 33 of file PayloadBlock.cpp.
dtn::data::PayloadBlock::PayloadBlock | ( | ibrcommon::BLOB::Reference | ref) |
Definition at line 38 of file PayloadBlock.cpp.
|
virtual |
Definition at line 43 of file PayloadBlock.cpp.
|
virtual |
Deserialize the derived block payload.
stream | A input stream to deserialize from. |
Implements dtn::data::Block.
Definition at line 87 of file PayloadBlock.cpp.
References ibrcommon::BLOB::iostream::clear(), ibrcommon::BLOB::copy(), dtn::data::Block::FORWARDED_WITHOUT_PROCESSED, ibrcommon::BLOB::Reference::iostream(), dtn::data::Block::set(), and ibrcommon::Exception::what().
ibrcommon::BLOB::Reference dtn::data::PayloadBlock::getBLOB | ( | ) | const |
Definition at line 47 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::data::CompressedPayloadBlock::extract(), main(), dtn::data::operator<<(), dtn::routing::NodeHandshakeExtension::processHandshake(), dtn::api::NativeSession::read(), dtn::api::ExtendedApiHandler::run(), dtn::security::PayloadIntegrityBlock::sign(), dtn::core::FragmentManager::split(), dtn::storage::SQLiteBundleStorage::store(), dtn::api::BundleStreamBuf::underflow(), dtn::data::CustodySignalBlock::write(), dtn::data::StatusReportBlock::write(), and dtn::api::NativeSession::write().
|
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 52 of file PayloadBlock.cpp.
References ibrcommon::BLOB::Reference::size().
Referenced by dtn::data::CompressedPayloadBlock::compress(), dtn::data::Bundle::getPayloadLength(), dtn::data::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::DefaultSerializer::serialize(), and dtn::core::FragmentManager::split().
|
virtual |
Serialize the derived block payload.
stream | A output stream to serialize into. |
Implements dtn::data::Block.
Definition at line 57 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, |
const Length & | clip_offset, | ||
const Length & | 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 72 of file PayloadBlock.cpp.
References ibrcommon::BLOB::copy(), ibrcommon::BLOB::Reference::iostream(), and ibrcommon::Exception::what().
|
static |
Definition at line 38 of file PayloadBlock.h.
Referenced by dtn::data::CompressedPayloadBlock::compress(), dtn::security::SecurityBlock::decryptBlock(), dtn::data::CompressedPayloadBlock::extract(), dtn::storage::SQLiteBundleStorage::get(), dtn::data::BundleBuilder::insert(), dtn::security::MutableSerializer::operator<<(), dtn::data::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::api::ExtendedApiHandler::run(), and dtn::storage::SQLiteBundleStorage::store().