IBR-DTNSuite
0.8
|
#include <AgeBlock.h>
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 |
Definition at line 20 of file AgeBlock.h.
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().
dtn::data::AgeBlock::~AgeBlock | ( | ) | [virtual] |
Definition at line 28 of file AgeBlock.cpp.
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.
stream | A input stream to deserialize from. |
Implements dtn::data::Block.
Definition at line 71 of file AgeBlock.cpp.
References ibrcommon::TimeMeasurement::start().
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().
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.
size_t dtn::data::AgeBlock::getMicroseconds | ( | ) | const |
Definition at line 32 of file AgeBlock.cpp.
References ibrcommon::TimeMeasurement::getMicroseconds(), dtn::data::SDNV::getValue(), and ibrcommon::TimeMeasurement::stop().
Referenced by dtn::daemon::DTNTPWorker::callbackBundleReceived(), getLength(), and serialize().
size_t dtn::data::AgeBlock::getSeconds | ( | ) | const |
Definition at line 40 of file AgeBlock.cpp.
References ibrcommon::TimeMeasurement::getMicroseconds(), dtn::data::SDNV::getValue(), and ibrcommon::TimeMeasurement::stop().
Referenced by dtn::utils::Clock::getExpireTime(), and dtn::utils::Clock::isExpired().
std::ostream & dtn::data::AgeBlock::serialize | ( | std::ostream & | stream, |
size_t & | length | ||
) | const [virtual] |
Serialize the derived block payload.
stream | A output stream to serialize into. |
Implements dtn::data::Block.
Definition at line 63 of file AgeBlock.cpp.
References dtn::data::SDNV::getLength(), and getMicroseconds().
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.
stream | the stream to be written into |
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.
const char dtn::data::AgeBlock::BLOCK_TYPE = 10 [static] |
Definition at line 31 of file AgeBlock.h.