Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef METABUNDLE_CPP_
00009 #define METABUNDLE_CPP_
00010
00011 #include "ibrdtn/data/MetaBundle.h"
00012
00013 namespace dtn
00014 {
00015 namespace data
00016 {
00017 MetaBundle::MetaBundle()
00018 : BundleID(), received(), lifetime(0), destination(), reportto(),
00019 custodian(), appdatalength(0), procflags(0)
00020 {
00021 }
00022
00023 MetaBundle::MetaBundle(const dtn::data::BundleID id, const size_t l,
00024 const dtn::data::DTNTime recv, const dtn::data::EID d, const dtn::data::EID r,
00025 const dtn::data::EID c, const size_t app, const size_t proc)
00026 : BundleID(id), received(recv), lifetime(l), destination(d), reportto(r),
00027 custodian(c), appdatalength(app), procflags(proc)
00028 {
00029 }
00030
00031 MetaBundle::MetaBundle(const dtn::data::Bundle &b)
00032 : BundleID(b), lifetime(b._lifetime), destination(b._destination), reportto(b._reportto),
00033 custodian(b._custodian), appdatalength(b._appdatalength), procflags(b._procflags)
00034 {
00035 }
00036
00037 MetaBundle::~MetaBundle()
00038 {}
00039
00040 int MetaBundle::getPriority() const
00041 {
00042
00043 if (procflags & dtn::data::Bundle::PRIORITY_BIT1)
00044 {
00045 return 0;
00046 }
00047 else
00048 {
00049 if (procflags & dtn::data::Bundle::PRIORITY_BIT2) return 1;
00050 else return -1;
00051 }
00052 }
00053 }
00054 }
00055
00056 #endif