IBR-DTNSuite
0.8
|
00001 /* 00002 * PayloadBlock.h 00003 * 00004 * Created on: 29.05.2009 00005 * Author: morgenro 00006 */ 00007 00008 00009 00010 #ifndef PAYLOADBLOCK_H_ 00011 #define PAYLOADBLOCK_H_ 00012 00013 #include "ibrdtn/data/Block.h" 00014 #include "ibrcommon/data/BLOB.h" 00015 00016 namespace dtn 00017 { 00018 namespace data 00019 { 00020 class PayloadBlock : public Block 00021 { 00022 public: 00023 static const char BLOCK_TYPE = 1; 00024 00025 PayloadBlock(); 00026 PayloadBlock(ibrcommon::BLOB::Reference ref); 00027 virtual ~PayloadBlock(); 00028 00029 ibrcommon::BLOB::Reference getBLOB() const; 00030 00031 virtual size_t getLength() const; 00032 virtual std::ostream &serialize(std::ostream &stream, size_t &length) const; 00033 virtual std::istream &deserialize(std::istream &stream, const size_t length); 00034 00042 std::ostream &serialize(std::ostream &stream, size_t clip_offset, size_t clip_length) const; 00043 00044 private: 00045 ibrcommon::BLOB::Reference _blobref; 00046 }; 00047 } 00048 } 00049 00050 #endif /* PAYLOADBLOCK_H_ */