dtn::data::Block Class Reference

#include <Block.h>

Inheritance diagram for dtn::data::Block:

dtn::data::PayloadBlock emma::DiscoverBlock dtn::data::AdministrativeBlock dtn::data::CustodySignalBlock dtn::data::StatusReportBlock

List of all members.

Public Member Functions

 Block (Block *block)
 Block (NetworkFrame *frame)
 Block (const Block &k)
virtual ~Block ()
NetworkFramegetFrame () const
virtual unsigned char getType () const
bool isProcessed () const
BlockFlags getBlockFlags () const
void setBlockFlags (BlockFlags flags)
unsigned int getHeaderSize () const
NetworkFramedissociateNetworkFrame ()
void updateBlockSize ()
virtual bool isAdministrativeBlock () const

Static Public Attributes

static const unsigned char BLOCK_TYPE = 0

Protected Member Functions

unsigned int getBodyIndex () const

Protected Attributes

bool m_processed

Private Attributes

NetworkFramem_frame


Detailed Description

base class for blocks of a bundle.

Constructor & Destructor Documentation

dtn::data::Block::Block ( Block block  ) 

Use a existing Block to create a new Block-Object. The used Block will be deleted.

Parameters:
[in] block The block to use as base.

References dissociateNetworkFrame().

dtn::data::Block::Block ( NetworkFrame frame  ) 

Use a existing NetworkFrame to create a new Block-Object.

Parameters:
[in] frame The NetworkFrame to use as base.

dtn::data::Block::Block ( const Block k  ) 

copy the block

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

Destructor

References m_frame.


Member Function Documentation

NetworkFrame & dtn::data::Block::getFrame (  )  const

get the reference to the NetworkFrame of this block

Returns:
the reference to the NetworkFrame of this block

References m_frame.

Referenced by emma::DiscoverBlockFactory::copy(), dtn::data::PayloadBlockFactory::copy(), dtn::data::BlockFactory::copy(), dtn::data::StatusReportBlock::getCreationTimestamp(), dtn::data::CustodySignalBlock::getCreationTimestamp(), dtn::data::StatusReportBlock::getCreationTimestampSequence(), dtn::data::CustodySignalBlock::getCreationTimestampSequence(), dtn::data::StatusReportBlock::getFragmentLength(), dtn::data::CustodySignalBlock::getFragmentLength(), dtn::data::StatusReportBlock::getFragmentOffset(), dtn::data::CustodySignalBlock::getFragmentOffset(), dtn::data::PayloadBlock::getLength(), dtn::data::PayloadBlock::getPayload(), dtn::data::PayloadBlock::getPayloadRange(), dtn::data::StatusReportBlock::getReasonCode(), dtn::data::StatusReportBlock::getSource(), dtn::data::CustodySignalBlock::getSource(), dtn::data::AdministrativeBlock::getStatusFlags(), dtn::data::StatusReportBlock::getTimeOfCustodyAcceptance(), dtn::data::StatusReportBlock::getTimeOfDeletion(), dtn::data::StatusReportBlock::getTimeOfDelivery(), dtn::data::StatusReportBlock::getTimeOfForwarding(), dtn::data::StatusReportBlock::getTimeOfReceipt(), dtn::data::CustodySignalBlock::getTimeOfSignal(), dtn::data::CustodySignalBlock::isAccepted(), dtn::data::PayloadBlockFactory::newCustodySignalBlock(), emma::DiscoverBlockFactory::newDiscoverBlock(), dtn::data::PayloadBlockFactory::newPayloadBlock(), dtn::data::PayloadBlockFactory::newStatusReportBlock(), emma::DiscoverBlockFactory::parse(), dtn::data::BundleFactory::parse(), dtn::data::CustodySignalBlock::setAccepted(), dtn::data::StatusReportBlock::setCreationTimestamp(), dtn::data::CustodySignalBlock::setCreationTimestamp(), dtn::data::StatusReportBlock::setCreationTimestampSequence(), dtn::data::CustodySignalBlock::setCreationTimestampSequence(), dtn::data::StatusReportBlock::setFragmentLength(), dtn::data::CustodySignalBlock::setFragmentLength(), dtn::data::StatusReportBlock::setFragmentOffset(), dtn::data::CustodySignalBlock::setFragmentOffset(), dtn::data::PayloadBlock::setPayload(), dtn::data::StatusReportBlock::setReasonCode(), dtn::data::StatusReportBlock::setSource(), dtn::data::CustodySignalBlock::setSource(), dtn::data::AdministrativeBlock::setStatusFlags(), dtn::data::StatusReportBlock::setTimeOfCustodyAcceptance(), dtn::data::StatusReportBlock::setTimeOfDeletion(), dtn::data::StatusReportBlock::setTimeOfDelivery(), dtn::data::StatusReportBlock::setTimeOfForwarding(), dtn::data::StatusReportBlock::setTimeOfReceipt(), dtn::data::CustodySignalBlock::setTimeOfSignal(), and updateBlockSize().

unsigned char dtn::data::Block::getType (  )  const [virtual]

Get the type of the block.

Returns:
The type of the block as char value.

References dtn::data::NetworkFrame::getChar(), and m_frame.

Referenced by dtn::data::BundleFactory::copyBlock(), and dtn::data::Bundle::getBlocks().

bool dtn::data::Block::isProcessed (  )  const

Returns:
true, if the block can't be processed

References m_processed.

BlockFlags dtn::data::Block::getBlockFlags (  )  const

Get the processing flags of the block.

Returns:
A BlockFlags object containing the processing flags.

References dtn::data::NetworkFrame::getSDNV(), and m_frame.

Referenced by dtn::data::Bundle::appendBlock(), getBodyIndex(), emma::DiscoverBlockFactory::newDiscoverBlock(), and dtn::data::Bundle::removeBlock().

void dtn::data::Block::setBlockFlags ( BlockFlags  flags  ) 

Set the processing flags of the block.

Parameters:
[in] flags A BlockFlags object containing the processing flags to set.

References dtn::data::ProcessingFlags::getValue(), m_frame, and dtn::data::NetworkFrame::set().

Referenced by dtn::data::Bundle::appendBlock(), and dtn::data::Bundle::removeBlock().

unsigned int dtn::data::Block::getHeaderSize (  )  const

Get the size of the header. This is the block size - payload size.

Returns:
the size of the header in bytes

References getBodyIndex(), dtn::data::NetworkFrame::getSize(), and m_frame.

NetworkFrame * dtn::data::Block::dissociateNetworkFrame (  ) 

dissociate the NetworkFrame from this object

Returns:
the pointer to the NetworkFrame of this block

References m_frame.

Referenced by Block(), and dtn::data::PayloadBlockFactory::castAdministrativeBlock().

void dtn::data::Block::updateBlockSize (  ) 

bool dtn::data::Block::isAdministrativeBlock (  )  const [virtual]

returns true, if this is a administrative block like CustodySignalBlock.

Reimplemented in dtn::data::AdministrativeBlock.

Referenced by dtn::data::PayloadBlockFactory::copy().

unsigned int dtn::data::Block::getBodyIndex (  )  const [protected]


Member Data Documentation

const unsigned char dtn::data::Block::BLOCK_TYPE = 0 [static]


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

Generated on Wed Mar 25 12:41:42 2009 for IBR-DTN by  doxygen 1.5.6