Classes | Public Member Functions | Static Public Attributes

dtn::data::AgeBlock Class Reference

#include <AgeBlock.h>

Inherits dtn::data::Block.

Collaboration diagram for dtn::data::AgeBlock:
Collaboration graph
[legend]

List of all members.

Classes

class  Factory

Public Member Functions

 AgeBlock ()
virtual ~AgeBlock ()
virtual size_t getLength () const
virtual std::ostream & serialize (std::ostream &stream) const
virtual std::istream & deserialize (std::istream &stream)
virtual std::ostream & serialize_strict (std::ostream &stream) const
virtual size_t getLength_strict () const
size_t getAge () const
void setAge (size_t value)
void addAge (size_t value)

Static Public Attributes

static const char BLOCK_TYPE = 10

Detailed Description

Definition at line 20 of file AgeBlock.h.


Constructor & Destructor Documentation

dtn::data::AgeBlock::AgeBlock (  ) 

Definition at line 19 of file AgeBlock.cpp.

References ibrcommon::TimeMeasurement::start().

Referenced by dtn::data::AgeBlock::Factory::create().

Here is the call graph for this function:

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

Definition at line 28 of file AgeBlock.cpp.


Member Function Documentation

void dtn::data::AgeBlock::addAge ( size_t  value  ) 

add a value to the age

Definition at line 39 of file AgeBlock.cpp.

std::istream & dtn::data::AgeBlock::deserialize ( std::istream &  stream  )  [virtual]

Deserialize the derived block payload.

Parameters:
stream A input stream to deserialize from.
Returns:
The same reference as given with the stream parameter.

Implements dtn::data::Block.

Definition at line 60 of file AgeBlock.cpp.

References ibrcommon::TimeMeasurement::start().

Here is the call graph for this function:

size_t dtn::data::AgeBlock::getAge (  )  const
size_t dtn::data::AgeBlock::getLength (  )  const [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 49 of file AgeBlock.cpp.

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

Here is the call graph for this function:

size_t dtn::data::AgeBlock::getLength_strict (  )  const [virtual]

Return the length of the payload in strict format

Reimplemented from dtn::data::Block.

Definition at line 67 of file AgeBlock.cpp.

std::ostream & dtn::data::AgeBlock::serialize ( std::ostream &  stream  )  const [virtual]

Serialize the derived block payload.

Parameters:
stream A output stream to serialize into.
Returns:
The same reference as given with the stream parameter.

Implements dtn::data::Block.

Definition at line 54 of file AgeBlock.cpp.

References getAge().

Here is the call graph for this function:

std::ostream & dtn::data::AgeBlock::serialize_strict ( std::ostream &  stream  )  const [virtual]

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

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

Reimplemented from dtn::data::Block.

Definition at line 72 of file AgeBlock.cpp.

void dtn::data::AgeBlock::setAge ( size_t  value  ) 

set the age

Definition at line 44 of file AgeBlock.cpp.


Member Data Documentation

const char dtn::data::AgeBlock::BLOCK_TYPE = 10 [static]

Definition at line 31 of file AgeBlock.h.


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