IBR-DTNSuite
0.12
|
#include <CompressedPayloadBlock.h>
Classes | |
class | Factory |
Public Types | |
enum | COMPRESS_ALGS { COMPRESSION_UNKNOWN = 0, COMPRESSION_ZLIB = 1, COMPRESSION_BZ2 = 2 } |
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 |
Public Member Functions | |
CompressedPayloadBlock () | |
virtual | ~CompressedPayloadBlock () |
virtual Length | getLength () const |
virtual std::ostream & | serialize (std::ostream &stream, Length &length) const |
virtual std::istream & | deserialize (std::istream &stream, const Length &length) |
void | setAlgorithm (COMPRESS_ALGS alg) |
COMPRESS_ALGS | getAlgorithm () const |
void | setOriginSize (const Number &s) |
const Number & | getOriginSize () 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 Member Functions | |
static void | compress (dtn::data::Bundle &b, COMPRESS_ALGS alg) |
static void | extract (dtn::data::Bundle &b) |
Static Public Attributes | |
static const dtn::data::block_t | BLOCK_TYPE = 202 |
Additional Inherited Members | |
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 34 of file CompressedPayloadBlock.h.
Enumerator | |
---|---|
COMPRESSION_UNKNOWN | |
COMPRESSION_ZLIB | |
COMPRESSION_BZ2 |
Definition at line 47 of file CompressedPayloadBlock.h.
dtn::data::CompressedPayloadBlock::CompressedPayloadBlock | ( | ) |
Definition at line 43 of file CompressedPayloadBlock.cpp.
Referenced by dtn::data::CompressedPayloadBlock::Factory::create().
|
virtual |
Definition at line 48 of file CompressedPayloadBlock.cpp.
|
static |
Definition at line 91 of file CompressedPayloadBlock.cpp.
References dtn::data::PayloadBlock::BLOCK_TYPE, ibrcommon::BLOB::create(), dtn::data::Bundle::end(), dtn::data::Bundle::erase(), dtn::data::Bundle::find(), dtn::data::PayloadBlock::getBLOB(), dtn::data::PayloadBlock::getLength(), dtn::data::Bundle::insert(), ibrcommon::BLOB::Reference::iostream(), dtn::data::Bundle::push_front(), setAlgorithm(), and setOriginSize().
Referenced by dtn::routing::NodeHandshakeExtension::processHandshake(), and dtn::api::Registration::processIncomingBundle().
|
virtual |
Deserialize the derived block payload.
stream | A input stream to deserialize from. |
Implements dtn::data::Block.
Definition at line 64 of file CompressedPayloadBlock.cpp.
|
static |
Definition at line 124 of file CompressedPayloadBlock.cpp.
References dtn::data::PayloadBlock::BLOCK_TYPE, ibrcommon::BLOB::create(), dtn::data::Bundle::end(), dtn::data::Bundle::erase(), dtn::data::Bundle::find(), getAlgorithm(), dtn::data::PayloadBlock::getBLOB(), dtn::data::Bundle::insert(), ibrcommon::BLOB::Reference::iostream(), and dtn::data::Bundle::remove().
Referenced by dtn::core::BundleCore::processBlocks().
CompressedPayloadBlock::COMPRESS_ALGS dtn::data::CompressedPayloadBlock::getAlgorithm | ( | ) | const |
Definition at line 76 of file CompressedPayloadBlock.cpp.
References dtn::data::SDNV< E >::get().
Referenced by extract().
|
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 CompressedPayloadBlock.cpp.
References dtn::data::SDNV< E >::getLength().
const Number & dtn::data::CompressedPayloadBlock::getOriginSize | ( | ) | const |
Definition at line 86 of file CompressedPayloadBlock.cpp.
|
virtual |
Serialize the derived block payload.
stream | A output stream to serialize into. |
Implements dtn::data::Block.
Definition at line 57 of file CompressedPayloadBlock.cpp.
References dtn::data::SDNV< E >::getLength().
void dtn::data::CompressedPayloadBlock::setAlgorithm | ( | CompressedPayloadBlock::COMPRESS_ALGS | alg) |
Definition at line 71 of file CompressedPayloadBlock.cpp.
Referenced by compress().
void dtn::data::CompressedPayloadBlock::setOriginSize | ( | const Number & | s) |
Definition at line 81 of file CompressedPayloadBlock.cpp.
Referenced by compress().
|
static |
Definition at line 45 of file CompressedPayloadBlock.h.
Referenced by dtn::core::BundleCore::processBlocks().