IBR-DTNSuite
0.8
|
#include <Block.h>
Public Types | |
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 } |
Public Member Functions | |
virtual | ~Block () |
virtual void | addEID (const dtn::data::EID &eid) |
virtual std::list< dtn::data::EID > | getEIDList () const |
char | getType () const |
void | set (ProcFlags flag, const bool &value) |
bool | get (ProcFlags flag) const |
virtual std::ostream & | serialize (std::ostream &stream, size_t &length) const =0 |
virtual std::istream & | deserialize (std::istream &stream, const size_t length)=0 |
virtual size_t | getLength () const =0 |
Protected Member Functions | |
Block (char blocktype) | |
virtual size_t | getLength_strict () const |
virtual std::ostream & | serialize_strict (std::ostream &stream, size_t &length) const |
Protected Attributes | |
char | _blocktype |
std::list< dtn::data::EID > | _eids |
Friends | |
class | Bundle |
class | DefaultSerializer |
class | dtn::security::StrictSerializer |
class | dtn::security::MutualSerializer |
class | DefaultDeserializer |
class | SeparateSerializer |
class | SeparateDeserializer |
dtn::data::Block::~Block | ( | ) | [virtual] |
dtn::data::Block::Block | ( | char | blocktype | ) | [protected] |
void dtn::data::Block::addEID | ( | const dtn::data::EID & | eid | ) | [virtual] |
Definition at line 27 of file Block.cpp.
References _eids, and BLOCK_CONTAINS_EIDS.
Referenced by dtn::api::PlainDeserializer::operator>>(), dtn::data::DefaultDeserializer::operator>>(), and dtn::data::SeparateDeserializer::operator>>().
virtual std::istream& dtn::data::Block::deserialize | ( | std::istream & | stream, |
const size_t | length | ||
) | [pure virtual] |
Deserialize the derived block payload.
stream | A input stream to deserialize from. |
Implemented in dtn::security::SecurityBlock, dtn::security::PayloadIntegrityBlock, dtn::data::StatusReportBlock, dtn::data::CustodySignalBlock, dtn::data::CompressedPayloadBlock, dtn::data::ExtensionBlock, dtn::data::StreamBlock, dtn::data::ScopeControlHopLimitBlock, dtn::data::AgeBlock, and dtn::data::PayloadBlock.
Referenced by dtn::api::PlainDeserializer::operator>>(), dtn::data::DefaultDeserializer::operator>>(), dtn::data::SeparateDeserializer::operator>>(), and dtn::api::ExtendedApiHandler::run().
bool dtn::data::Block::get | ( | ProcFlags | flag | ) | const |
Definition at line 52 of file Block.cpp.
Referenced by dtn::security::SecurityBlock::decryptBlock(), dtn::security::MutualSerializer::getLength(), dtn::data::DefaultSerializer::getLength(), dtn::data::SeparateSerializer::getLength(), dtn::api::PlainSerializer::operator<<(), dtn::security::StrictSerializer::operator<<(), dtn::security::MutualSerializer::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), dtn::api::PlainDeserializer::operator>>(), dtn::data::DefaultDeserializer::operator>>(), dtn::data::SeparateDeserializer::operator>>(), dtn::data::DefaultSerializer::serialize(), and dtn::core::BundleCore::validate().
std::list< dtn::data::EID > dtn::data::Block::getEIDList | ( | ) | const [virtual] |
Definition at line 35 of file Block.cpp.
References _eids.
Referenced by dtn::security::SecurityBlock::decryptBlock(), dtn::data::Dictionary::Dictionary(), dtn::data::DefaultSerializer::isCompressable(), dtn::api::PlainSerializer::operator<<(), and dtn::data::DefaultSerializer::rebuildDictionary().
virtual size_t dtn::data::Block::getLength | ( | ) | const [pure 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.
Implemented in dtn::security::SecurityBlock, dtn::data::StatusReportBlock, dtn::data::CustodySignalBlock, dtn::data::CompressedPayloadBlock, dtn::data::ExtensionBlock, dtn::data::StreamBlock, dtn::data::ScopeControlHopLimitBlock, dtn::data::AgeBlock, and dtn::data::PayloadBlock.
Referenced by dtn::security::MutualSerializer::getLength(), dtn::data::DefaultSerializer::getLength(), dtn::data::SeparateSerializer::getLength(), getLength_strict(), dtn::api::PlainSerializer::operator<<(), dtn::security::MutualSerializer::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), dtn::api::ExtendedApiHandler::run(), and dtn::storage::SQLiteBundleStorage::store().
size_t dtn::data::Block::getLength_strict | ( | ) | const [protected, virtual] |
Return the length of the payload in strict format
Reimplemented in dtn::data::AgeBlock.
Definition at line 57 of file Block.cpp.
References getLength().
Referenced by dtn::security::StrictSerializer::operator<<().
char dtn::data::Block::getType | ( | ) | const [inline] |
Definition at line 58 of file Block.h.
References _blocktype.
Referenced by dtn::api::PlainSerializer::operator<<(), dtn::security::StrictSerializer::operator<<(), dtn::security::MutualSerializer::operator<<(), dtn::core::BundleCore::processBlocks(), and dtn::storage::SQLiteDatabase::store().
virtual std::ostream& dtn::data::Block::serialize | ( | std::ostream & | stream, |
size_t & | length | ||
) | const [pure virtual] |
Serialize the derived block payload.
stream | A output stream to serialize into. |
Implemented in dtn::security::SecurityBlock, dtn::data::StatusReportBlock, dtn::data::CustodySignalBlock, dtn::data::CompressedPayloadBlock, dtn::data::ExtensionBlock, dtn::data::StreamBlock, dtn::data::ScopeControlHopLimitBlock, dtn::data::AgeBlock, and dtn::data::PayloadBlock.
Referenced by dtn::api::PlainSerializer::operator<<(), dtn::security::MutualSerializer::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), dtn::api::ExtendedApiHandler::run(), and serialize_strict().
std::ostream & dtn::data::Block::serialize_strict | ( | std::ostream & | stream, |
size_t & | length | ||
) | const [protected, 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 in dtn::security::SecurityBlock, and dtn::data::AgeBlock.
Definition at line 62 of file Block.cpp.
References serialize().
Referenced by dtn::security::StrictSerializer::operator<<().
void dtn::data::Block::set | ( | ProcFlags | flag, |
const bool & | value | ||
) |
Definition at line 40 of file Block.cpp.
Referenced by dtn::security::BundleAuthenticationBlock::auth(), dtn::api::PlainDeserializer::operator>>(), dtn::data::Bundle::BlockList::push_back(), dtn::data::Bundle::BlockList::push_front(), dtn::api::PlainDeserializer::readBlock(), dtn::api::ExtendedApiHandler::run(), and dtn::security::PayloadIntegrityBlock::sign().
friend class DefaultDeserializer [friend] |
friend class DefaultSerializer [friend] |
friend class dtn::security::MutualSerializer [friend] |
friend class dtn::security::StrictSerializer [friend] |
friend class SeparateDeserializer [friend] |
friend class SeparateSerializer [friend] |
char dtn::data::Block::_blocktype [protected] |
Definition at line 103 of file Block.h.
Referenced by dtn::security::SecurityBlock::deserialize(), dtn::security::MutualSerializer::getLength(), dtn::data::DefaultSerializer::getLength(), dtn::data::SeparateSerializer::getLength(), getType(), dtn::security::StrictSerializer::operator<<(), dtn::security::MutualSerializer::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), dtn::data::DefaultDeserializer::operator>>(), dtn::data::SeparateDeserializer::operator>>(), and dtn::data::DefaultSerializer::serialize().
std::list<dtn::data::EID> dtn::data::Block::_eids [protected] |
Definition at line 106 of file Block.h.
Referenced by addEID(), dtn::security::SecurityBlock::deserialize(), getEIDList(), dtn::security::MutualSerializer::getLength(), dtn::data::DefaultSerializer::getLength(), dtn::data::SeparateSerializer::getLength(), dtn::security::StrictSerializer::operator<<(), dtn::security::MutualSerializer::operator<<(), dtn::data::DefaultSerializer::operator<<(), dtn::data::SeparateSerializer::operator<<(), dtn::data::DefaultSerializer::serialize(), and dtn::security::SecurityBlock::store_security_references().