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

#include <CompressedPayloadBlock.h>

Inheritance diagram for dtn::data::CompressedPayloadBlock:
Collaboration diagram for dtn::data::CompressedPayloadBlock:

List of all members.

Classes

class  Factory

Public Types

enum  COMPRESS_ALGS { COMPRESSION_UNKNOWN = 0, COMPRESSION_ZLIB = 1, COMPRESSION_BZ2 = 2 }

Public Member Functions

 CompressedPayloadBlock ()
virtual ~CompressedPayloadBlock ()
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)
void setAlgorithm (COMPRESS_ALGS alg)
COMPRESS_ALGS getAlgorithm () const
void setOriginSize (size_t s)
size_t getOriginSize () 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 char BLOCK_TYPE = 202

Detailed Description

Definition at line 20 of file CompressedPayloadBlock.h.


Member Enumeration Documentation

Enumerator:
COMPRESSION_UNKNOWN 
COMPRESSION_ZLIB 
COMPRESSION_BZ2 

Definition at line 33 of file CompressedPayloadBlock.h.


Constructor & Destructor Documentation


Member Function Documentation

std::istream & dtn::data::CompressedPayloadBlock::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 47 of file CompressedPayloadBlock.cpp.

Definition at line 59 of file CompressedPayloadBlock.cpp.

References dtn::data::SDNV::getValue().

Referenced by extract().

Here is the call graph for this function:

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 CompressedPayloadBlock.cpp.

References dtn::data::SDNV::getLength().

Here is the call graph for this function:

Definition at line 69 of file CompressedPayloadBlock.cpp.

References dtn::data::SDNV::getValue().

Here is the call graph for this function:

std::ostream & dtn::data::CompressedPayloadBlock::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 41 of file CompressedPayloadBlock.cpp.

Definition at line 64 of file CompressedPayloadBlock.cpp.

Referenced by compress().


Member Data Documentation

Definition at line 31 of file CompressedPayloadBlock.h.

Referenced by dtn::core::BundleCore::processBlocks().


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