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

#include <Block.h>

Inheritance diagram for dtn::data::Block:

List of all members.

Public Types

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
}

Public Member Functions

virtual ~Block ()
virtual void addEID (const dtn::data::EID &eid)
virtual std::list< dtn::data::EIDgetEIDList () const
char getType () const
void set (ProcFlags flag, const bool &value)
bool get (ProcFlags flag) const
virtual std::ostream & serialize (std::ostream &stream, size_t &length) const =0
virtual std::istream & deserialize (std::istream &stream, const size_t length)=0
virtual size_t getLength () const =0

Protected Member Functions

 Block (char blocktype)
virtual size_t getLength_strict () const
virtual std::ostream & serialize_strict (std::ostream &stream, size_t &length) const

Protected Attributes

char _blocktype
std::list< dtn::data::EID_eids

Friends

class Bundle
class DefaultSerializer
class dtn::security::StrictSerializer
class dtn::security::MutualSerializer
class DefaultDeserializer
class SeparateSerializer
class SeparateDeserializer

Detailed Description

Definition at line 31 of file Block.h.


Member Enumeration Documentation

Enumerator:
REPLICATE_IN_EVERY_FRAGMENT 
TRANSMIT_STATUSREPORT_IF_NOT_PROCESSED 
DELETE_BUNDLE_IF_NOT_PROCESSED 
LAST_BLOCK 
DISCARD_IF_NOT_PROCESSED 
FORWARDED_WITHOUT_PROCESSED 
BLOCK_CONTAINS_EIDS 

Definition at line 42 of file Block.h.


Constructor & Destructor Documentation

dtn::data::Block::~Block ( ) [virtual]

Definition at line 23 of file Block.cpp.

dtn::data::Block::Block ( char  blocktype) [protected]

The constructor of this class is protected to prevent instantiation of this abstract class.

Parameters:
blocktypeThe type of the block.

Definition at line 18 of file Block.cpp.


Member Function Documentation

size_t dtn::data::Block::getLength_strict ( ) const [protected, virtual]

Return the length of the payload in strict format

Reimplemented in dtn::data::AgeBlock.

Definition at line 57 of file Block.cpp.

References getLength().

Referenced by dtn::security::StrictSerializer::operator<<().

Here is the call graph for this function:

std::ostream & dtn::data::Block::serialize_strict ( std::ostream &  stream,
size_t &  length 
) const [protected, virtual]

Serialize the block in a strict way. Dynamic fields are set to the last deserialized value.

Parameters:
streamthe stream to be written into
Returns:
the same stream as the parameter for chaining

Reimplemented in dtn::security::SecurityBlock, and dtn::data::AgeBlock.

Definition at line 62 of file Block.cpp.

References serialize().

Referenced by dtn::security::StrictSerializer::operator<<().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class Bundle [friend]

Definition at line 33 of file Block.h.

friend class DefaultDeserializer [friend]

Definition at line 37 of file Block.h.

friend class DefaultSerializer [friend]

Definition at line 34 of file Block.h.

friend class dtn::security::MutualSerializer [friend]

Definition at line 36 of file Block.h.

friend class dtn::security::StrictSerializer [friend]

Definition at line 35 of file Block.h.

friend class SeparateDeserializer [friend]

Definition at line 39 of file Block.h.

friend class SeparateSerializer [friend]

Definition at line 38 of file Block.h.


Member Data Documentation


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