|
IBR-DTNSuite
0.12
|
#include <AgeBlock.h>


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 () |
| Block & | operator= (const Block &block) |
| bool | operator== (const block_t &id) const |
| virtual void | addEID (const dtn::data::EID &eid) |
| virtual void | clearEIDs () |
| virtual const eid_list & | getEIDList () const |
| const block_t & | getType () 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::EID > | eid_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 |
Definition at line 34 of file AgeBlock.h.
| dtn::data::AgeBlock::AgeBlock | ( | ) |
Definition at line 36 of file AgeBlock.cpp.
References dtn::data::Block::REPLICATE_IN_EVERY_FRAGMENT, dtn::data::Block::set(), and ibrcommon::TimeMeasurement::start().
Referenced by dtn::data::AgeBlock::Factory::create().

|
virtual |
Definition at line 45 of file AgeBlock.cpp.
| 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().
|
virtual |
Deserialize the derived block payload.
| stream | A input stream to deserialize from. |
Implements dtn::data::Block.
Definition at line 94 of file AgeBlock.cpp.
References ibrcommon::TimeMeasurement::start().

|
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().

|
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().

| 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().

|
virtual |
Serialize the derived block payload.
| stream | A output stream to serialize into. |
Implements dtn::data::Block.
Definition at line 86 of file AgeBlock.cpp.
References dtn::data::SDNV< E >::getLength(), and getMicroseconds().

|
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 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.
|
static |
Definition at line 45 of file AgeBlock.h.
Referenced by dtn::daemon::DTNTPWorker::callbackBundleReceived().