38 const std::string MemoryBundleStorage::TAG =
"MemoryBundleStorage";
71 }
catch (
const std::bad_cast&) { }
76 return MemoryBundleStorage::TAG;
82 return _bundles.empty();
94 return _bundles.size();
99 size_t items_added = 0;
104 for (prio_bundle_set::const_iterator iter = _priority_index.begin(); (iter != _priority_index.end()) && ((cb.limit() == 0) || (items_added < cb.limit())); ++iter)
111 if ( cb.shouldAdd(bundle) )
126 for (bundle_list::const_iterator iter = _bundles.begin(); iter != _bundles.end(); ++iter)
153 std::set<dtn::data::EID> ret;
157 for (bundle_list::const_iterator iter = _bundles.begin(); iter != _bundles.end(); ++iter)
180 pair<set<dtn::data::Bundle>::iterator,
bool> ret = _bundles.insert( bundle );
186 _priority_index.insert(m);
188 _bundle_lengths[m] =
size;
205 return (_bundle_lengths.find(
id) != _bundle_lengths.end());
229 const bundle_list::const_iterator iter = find(_bundles.begin(), _bundles.end(), id);
249 for (bundle_list::const_iterator iter = _bundles.begin(); iter != _bundles.end(); ++iter)
258 _priority_index.clear();
260 _bundle_lengths.clear();
269 const bundle_list::iterator iter = find(_bundles.begin(), _bundles.end(), b);
272 if (iter != _bundles.end())
275 eventBundleRemoved(b);
288 void MemoryBundleStorage::__erase(
const bundle_list::iterator &iter)
293 _priority_index.erase(m);
297 _bundle_lengths.erase(m);
303 _bundles.erase(iter);