IBR-DTNSuite
0.12
|
#include <MemoryBundleSet.h>
Public Member Functions | |
MemoryBundleSet (BundleSet::Listener *listener=NULL, Length bf_size=1024) | |
MemoryBundleSet (const std::string &name, BundleSet::Listener *listener=NULL, Length bf_size=1024) | |
virtual | ~MemoryBundleSet () |
virtual refcnt_ptr< BundleSetImpl > | copy () const |
virtual void | assign (const refcnt_ptr< BundleSetImpl > &) |
virtual void | add (const dtn::data::MetaBundle &bundle) throw () |
virtual void | clear () throw () |
virtual bool | has (const dtn::data::BundleID &bundle) const throw () |
virtual void | expire (const Timestamp timestamp) throw () |
virtual Size | size () const throw () |
Length | getLength () const throw () |
const ibrcommon::BloomFilter & | getBloomFilter () const throw () |
std::set< dtn::data::MetaBundle > | getNotIn (const ibrcommon::BloomFilter &filter) const throw () |
virtual std::ostream & | serialize (std::ostream &stream) const |
virtual std::istream & | deserialize (std::istream &stream) |
virtual void | sync () throw () |
Public Member Functions inherited from dtn::data::BundleSetImpl | |
virtual | ~BundleSetImpl ()=0 |
Static Public Member Functions | |
static void | setPath (const ibrcommon::File &path) |
Definition at line 38 of file MemoryBundleSet.h.
dtn::data::MemoryBundleSet::MemoryBundleSet | ( | BundleSet::Listener * | listener = NULL , |
Length | bf_size = 1024 |
||
) |
Constructor
listener | This listener gets notified about expired bundles. |
bf_size | Initial size fo the bloom-filter. |
Definition at line 33 of file MemoryBundleSet.cpp.
Referenced by copy().
dtn::data::MemoryBundleSet::MemoryBundleSet | ( | const std::string & | name, |
BundleSet::Listener * | listener = NULL , |
||
Length | bf_size = 1024 |
||
) |
Constructor
name | The identifier of the named bundle-set. |
listener | This listener gets notified about expired bundles. |
bf_size | Initial size fo the bloom-filter. |
Definition at line 38 of file MemoryBundleSet.cpp.
|
virtual |
Destructor
Definition at line 50 of file MemoryBundleSet.cpp.
|
virtual |
Add a bundle to the bundle-set
Implements dtn::data::BundleSetImpl.
Definition at line 85 of file MemoryBundleSet.cpp.
|
virtual |
clears the bundle-set and copy all entries from the given one into this bundle-set
Implements dtn::data::BundleSetImpl.
Definition at line 67 of file MemoryBundleSet.cpp.
References add(), clear(), and refcnt_ptr< T >::getPointer().
|
virtual |
Clear the whole bundle-set
Implements dtn::data::BundleSetImpl.
Definition at line 97 of file MemoryBundleSet.cpp.
References ibrcommon::BloomFilter::clear().
Referenced by assign(), and deserialize().
|
virtual |
copies the current bundle-set into a new temporary one
Implements dtn::data::BundleSetImpl.
Definition at line 55 of file MemoryBundleSet.cpp.
References add(), and MemoryBundleSet().
|
virtual |
Load the bloom-filter from a stream
Implements dtn::data::BundleSetImpl.
Definition at line 205 of file MemoryBundleSet.cpp.
References clear(), and ibrcommon::BloomFilter::load().
|
virtual |
Check for expired entries in this bundle-set and remove them
Implements dtn::data::BundleSetImpl.
Definition at line 125 of file MemoryBundleSet.cpp.
References dtn::data::BundleSetImpl::ExpiringBundle::bundle, and dtn::data::MetaBundle::expiretime.
|
virtual |
Get the bloom-filter of this bundle-set
Implements dtn::data::BundleSetImpl.
Definition at line 165 of file MemoryBundleSet.cpp.
|
virtual |
Returns the data length of the serialized BundleSet
Implements dtn::data::BundleSetImpl.
Definition at line 189 of file MemoryBundleSet.cpp.
References ibrcommon::BloomFilter::size().
|
virtual |
Return bundles not in the given bloom-filter
Implements dtn::data::BundleSetImpl.
Definition at line 170 of file MemoryBundleSet.cpp.
|
virtual |
Check if a bundle id is in this bundle-set
Implements dtn::data::BundleSetImpl.
Definition at line 105 of file MemoryBundleSet.cpp.
References dtn::data::MetaBundle::create().
|
virtual |
Serialize the bloom-filter of this bundle-set into a stream
Implements dtn::data::BundleSetImpl.
Definition at line 194 of file MemoryBundleSet.cpp.
References size(), ibrcommon::BloomFilter::size(), and ibrcommon::BloomFilter::table().
|
static |
Sets the store path for MemoryBundleSets
Definition at line 223 of file MemoryBundleSet.cpp.
References ibrcommon::File::createDirectory(), ibrcommon::File::exists(), and ibrcommon::File::isDirectory().
|
virtual |
Returns the number of elements in this set
Implements dtn::data::BundleSetImpl.
Definition at line 120 of file MemoryBundleSet.cpp.
Referenced by serialize().
|
virtual |
Synchronize the bundle-set with the persistent set on the disk.
Reimplemented from dtn::data::BundleSetImpl.
Definition at line 237 of file MemoryBundleSet.cpp.