• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ibrdtn/ibrdtn/data/AgeBlock.h

Go to the documentation of this file.
00001 /*
00002  * AgeBlock.h
00003  *
00004  *  Created on: 18.11.2010
00005  *      Author: morgenro
00006  */
00007 
00008 #include <ibrdtn/data/Block.h>
00009 #include <ibrdtn/data/SDNV.h>
00010 #include <ibrdtn/data/ExtensionBlock.h>
00011 #include <ibrcommon/TimeMeasurement.h>
00012 
00013 #ifndef AGEBLOCK_H_
00014 #define AGEBLOCK_H_
00015 
00016 namespace dtn
00017 {
00018         namespace data
00019         {
00020                 class AgeBlock : public dtn::data::Block
00021                 {
00022                 public:
00023                         class Factory : public dtn::data::ExtensionBlock::Factory
00024                         {
00025                         public:
00026                                 Factory() : dtn::data::ExtensionBlock::Factory(AgeBlock::BLOCK_TYPE) {};
00027                                 virtual ~Factory() {};
00028                                 virtual dtn::data::Block* create();
00029                         };
00030 
00031                         static const char BLOCK_TYPE = 10;
00032 
00033                         AgeBlock();
00034                         virtual ~AgeBlock();
00035 
00036                         virtual size_t getLength() const;
00037                         virtual std::ostream &serialize(std::ostream &stream) const;
00038                         virtual std::istream &deserialize(std::istream &stream);
00039 
00040                         virtual std::ostream &serialize_strict(std::ostream &stream) const;
00041                         virtual size_t getLength_strict() const;
00042 
00043                         size_t getAge() const;
00044 
00048                         void setAge(size_t value);
00049 
00053                         void addAge(size_t value);
00054 
00055                 private:
00056                         dtn::data::SDNV _age;
00057                         ibrcommon::TimeMeasurement _time;
00058                 };
00059 
00063                 static AgeBlock::Factory __AgeBlockFactory__;
00064         }
00065 }
00066 
00067 #endif /* AGEBLOCK_H_ */

Generated on Wed Mar 30 2011 11:11:49 for IBR-DTNSuite by  doxygen 1.7.1