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

#include <AgeBlock.h>

Inheritance diagram for dtn::data::AgeBlock:
Collaboration diagram for dtn::data::AgeBlock:

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, size_t &length) const
virtual std::istream & deserialize (std::istream &stream, const size_t length)
virtual std::ostream & serialize_strict (std::ostream &stream, size_t &length) const
virtual size_t getLength_strict () const
size_t getMicroseconds () const
size_t getSeconds () const
void setSeconds (size_t value)
void addSeconds (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

Definition at line 19 of file AgeBlock.cpp.

References dtn::data::Block::REPLICATE_IN_EVERY_FRAGMENT, and ibrcommon::TimeMeasurement::start().

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

Here is the call graph for this function:

Definition at line 28 of file AgeBlock.cpp.


Member Function Documentation

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

add a value to the age

Definition at line 48 of file AgeBlock.cpp.

Referenced by dtn::storage::SQLiteBundleStorage::get().

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

References ibrcommon::TimeMeasurement::start().

Here is the call graph for this function:

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 58 of file AgeBlock.cpp.

References dtn::data::SDNV::getLength(), and getMicroseconds().

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 78 of file AgeBlock.cpp.

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

References dtn::data::SDNV::getLength(), and getMicroseconds().

Here is the call graph for this function:

std::ostream & dtn::data::AgeBlock::serialize_strict ( std::ostream &  stream,
size_t &  length 
) const [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 from dtn::data::Block.

Definition at line 83 of file AgeBlock.cpp.

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

set the age

Definition at line 53 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: