IBR-DTNSuite  0.8
ibrdtn/ibrdtn/data/BundleID.h
Go to the documentation of this file.
00001 /*
00002  * BundleID.h
00003  *
00004  *  Created on: 01.09.2009
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef BUNDLEID_H_
00009 #define BUNDLEID_H_
00010 
00011 #include "ibrdtn/data/EID.h"
00012 #include "ibrdtn/data/Bundle.h"
00013 
00014 namespace dtn
00015 {
00016         namespace data
00017         {
00018                 class BundleID
00019                 {
00020                 public:
00021                         BundleID(const dtn::data::EID source = dtn::data::EID(), const size_t timestamp = 0, const size_t sequencenumber = 0, const bool fragment = false, const size_t offset = 0);
00022                         BundleID(const dtn::data::Bundle &b);
00023                         virtual ~BundleID();
00024 
00025                         bool operator!=(const BundleID& other) const;
00026                         bool operator==(const BundleID& other) const;
00027                         bool operator<(const BundleID& other) const;
00028                         bool operator>(const BundleID& other) const;
00029 
00030                         string toString() const;
00031                         size_t getTimestamp() const;
00032 
00033                         friend std::ostream &operator<<(std::ostream &stream, const BundleID &obj);
00034                         friend std::istream &operator>>(std::istream &stream, BundleID &obj);
00035 
00036                         dtn::data::EID source;
00037                         size_t timestamp;
00038                         size_t sequencenumber;
00039 
00040                         bool fragment;
00041                         size_t offset;
00042                 };
00043         }
00044 }
00045 
00046 #endif /* BUNDLEID_H_ */