41 pair<iterator,bool> ret = _meta_bundles.insert(bundle);
44 ExpiringBundle exb(*ret.first);
52 const std::set<dtn::data::MetaBundle>::iterator it = _meta_bundles.find(bundle);
55 if (it != _meta_bundles.end())
61 _meta_bundles.erase(it);
68 _meta_bundles.clear();
74 if (timestamp == 0)
return;
76 std::set<ExpiringBundle>::iterator iter = _bundles.begin();
78 while (iter != _bundles.end())
80 const ExpiringBundle &b = (*iter);
82 if ( b.bundle.expiretime >= timestamp )
break;
85 if (_listener != NULL)
86 _listener->eventBundleExpired( b.bundle );
89 _meta_bundles.erase( b.bundle );
92 _bundles.erase( iter++ );
96 BundleList::ExpiringBundle::ExpiringBundle(
const MetaBundle &b)
100 BundleList::ExpiringBundle::~ExpiringBundle()
103 bool BundleList::ExpiringBundle::operator!=(
const ExpiringBundle& other)
const
105 return !(other == *
this);
108 bool BundleList::ExpiringBundle::operator==(
const ExpiringBundle& other)
const
110 return (other.bundle == this->bundle);
113 bool BundleList::ExpiringBundle::operator<(
const ExpiringBundle& other)
const
115 if (bundle.expiretime < other.bundle.expiretime)
return true;
116 if (bundle.expiretime != other.bundle.expiretime)
return false;
118 if (bundle < other.bundle)
return true;
123 bool BundleList::ExpiringBundle::operator>(
const ExpiringBundle& other)
const
125 return !(((*this) < other) || ((*
this) == other));