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

#include <AgeBlock.h>

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

Classes

class  Factory
 

Public Member Functions

 AgeBlock ()
 
virtual ~AgeBlock ()
 
virtual dtn::data::Length getLength () const
 
virtual std::ostream & serialize (std::ostream &stream, dtn::data::Length &length) const
 
virtual std::istream & deserialize (std::istream &stream, const dtn::data::Length &length)
 
virtual std::ostream & serialize_strict (std::ostream &stream, dtn::data::Length &length) const
 
virtual dtn::data::Length getLength_strict () const
 
dtn::data::Number getMicroseconds () const
 
dtn::data::Number getSeconds () const
 
void setSeconds (const dtn::data::Number &value)
 
void addSeconds (const dtn::data::Number &value)
 
void setMicroseconds (const dtn::data::Number &value)
 
void addMicroseconds (const dtn::data::Number &value)
 
- Public Member Functions inherited from dtn::data::Block
virtual ~Block ()
 
Blockoperator= (const Block &block)
 
bool operator== (const block_t &id) const
 
virtual void addEID (const dtn::data::EID &eid)
 
virtual void clearEIDs ()
 
virtual const eid_listgetEIDList () const
 
const block_tgetType () const
 
void set (ProcFlags flag, const bool &value)
 
bool get (ProcFlags flag) const
 
const Bitset< ProcFlags > & getProcessingFlags () const
 

Static Public Attributes

static const dtn::data::block_t BLOCK_TYPE = 10
 

Additional Inherited Members

- Public Types inherited from dtn::data::Block
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
}
 
typedef std::list< dtn::data::EIDeid_list
 
- Protected Member Functions inherited from dtn::data::Block
 Block (block_t blocktype)
 
- Protected Attributes inherited from dtn::data::Block
block_t _blocktype
 
eid_list _eids
 

Detailed Description

Definition at line 34 of file AgeBlock.h.

Constructor & Destructor Documentation

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

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

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

Definition at line 45 of file AgeBlock.cpp.

Member Function Documentation

void dtn::data::AgeBlock::addMicroseconds ( const dtn::data::Number value)

add microseconds to the ageblock

Definition at line 61 of file AgeBlock.cpp.

void dtn::data::AgeBlock::addSeconds ( const dtn::data::Number value)

add a value to the age

Definition at line 71 of file AgeBlock.cpp.

Referenced by dtn::storage::SimpleBundleStorage::get(), and dtn::storage::SQLiteBundleStorage::get().

std::istream & dtn::data::AgeBlock::deserialize ( std::istream &  stream,
const dtn::data::Length 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 94 of file AgeBlock.cpp.

References ibrcommon::TimeMeasurement::start().

Here is the call graph for this function:

dtn::data::Length 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 81 of file AgeBlock.cpp.

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

Here is the call graph for this function:

dtn::data::Length dtn::data::AgeBlock::getLength_strict ( ) const
virtual

Return the length of the payload in strict format

Reimplemented from dtn::data::Block.

Definition at line 101 of file AgeBlock.cpp.

dtn::data::Number dtn::data::AgeBlock::getMicroseconds ( ) const

Definition at line 49 of file AgeBlock.cpp.

References ibrcommon::TimeMeasurement::getMicroseconds(), and ibrcommon::TimeMeasurement::stop().

Referenced by dtn::daemon::DTNTPWorker::callbackBundleReceived(), getLength(), getSeconds(), and serialize().

Here is the call graph for this function:

dtn::data::Number dtn::data::AgeBlock::getSeconds ( ) const

Definition at line 56 of file AgeBlock.cpp.

References getMicroseconds().

Referenced by dtn::daemon::DTNTPWorker::callbackBundleReceived(), dtn::utils::Clock::getExpireTime(), and dtn::utils::Clock::isExpired().

Here is the call graph for this function:

std::ostream & dtn::data::AgeBlock::serialize ( std::ostream &  stream,
dtn::data::Length 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 86 of file AgeBlock.cpp.

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

Here is the call graph for this function:

std::ostream & dtn::data::AgeBlock::serialize_strict ( std::ostream &  stream,
dtn::data::Length 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 106 of file AgeBlock.cpp.

void dtn::data::AgeBlock::setMicroseconds ( const dtn::data::Number value)

set the age

Definition at line 66 of file AgeBlock.cpp.

void dtn::data::AgeBlock::setSeconds ( const dtn::data::Number value)

set the age

Definition at line 76 of file AgeBlock.cpp.

Member Data Documentation

const dtn::data::block_t dtn::data::AgeBlock::BLOCK_TYPE = 10
static

Definition at line 45 of file AgeBlock.h.

Referenced by dtn::daemon::DTNTPWorker::callbackBundleReceived().


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