IBR-DTNSuite
0.12
|
#include <BundleSet.h>
Classes | |
class | Factory |
class | Listener |
Public Member Functions | |
BundleSet (BundleSet::Listener *listener=NULL, Length bf_size=1024) | |
BundleSet (const std::string &name, BundleSet::Listener *listener=NULL, Length bf_size=1024) | |
virtual | ~BundleSet () |
BundleSet (const BundleSet &) | |
BundleSet & | operator= (const BundleSet &) |
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 () |
void | sync () throw () |
std::ostream & | serialize (std::ostream &stream) const |
std::istream & | deserialize (std::istream &stream) |
Static Public Member Functions | |
static void | setFactory (dtn::data::BundleSet::Factory *) |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const BundleSet &obj) |
std::istream & | operator>> (std::istream &stream, BundleSet &obj) |
Definition at line 35 of file BundleSet.h.
dtn::data::BundleSet::BundleSet | ( | BundleSet::Listener * | listener = NULL , |
Length | bf_size = 1024 |
||
) |
Creates a new bundle-set with the default bundle-set factory
bf_size | Initial size fo the bloom-filter. |
Definition at line 70 of file BundleSet.cpp.
dtn::data::BundleSet::BundleSet | ( | const std::string & | name, |
BundleSet::Listener * | listener = NULL , |
||
Length | bf_size = 1024 |
||
) |
Creates a new bundle-set with the default bundle-set factory
bf_size | Initial size fo the bloom-filter. |
Definition at line 75 of file BundleSet.cpp.
|
virtual |
Destructor
Definition at line 85 of file BundleSet.cpp.
dtn::data::BundleSet::BundleSet | ( | const BundleSet & | other) |
Copy constructor
Definition at line 80 of file BundleSet.cpp.
|
virtual |
Add a bundle to this bundle-set
Definition at line 95 of file BundleSet.cpp.
Referenced by dtn::routing::BaseRouter::filterKnown(), dtn::routing::BaseRouter::setKnown(), and dtn::routing::BaseRouter::setPurged().
|
virtual |
Clear all entries
Definition at line 100 of file BundleSet.cpp.
std::istream & dtn::data::BundleSet::deserialize | ( | std::istream & | stream) |
Definition at line 145 of file BundleSet.cpp.
Referenced by dtn::data::operator>>().
|
virtual |
Remove expired bundles in this bundle-set
Definition at line 115 of file BundleSet.cpp.
const ibrcommon::BloomFilter & dtn::data::BundleSet::getBloomFilter | ( | ) | const | |
throw | ( | |||
) |
Return the bloom-filter object of this bundle-set
Definition at line 120 of file BundleSet.cpp.
Referenced by dtn::routing::NodeHandshakeExtension::processHandshake().
Length dtn::data::BundleSet::getLength | ( | ) | const | |
throw | ( | |||
) |
Returns the data length of the serialized BundleSet
Definition at line 135 of file BundleSet.cpp.
Referenced by dtn::routing::BloomFilterSummaryVector::getLength(), and dtn::routing::BloomFilterPurgeVector::getLength().
std::set< dtn::data::MetaBundle > dtn::data::BundleSet::getNotIn | ( | const ibrcommon::BloomFilter & | filter) | const | |
throw | ( | ||||
) |
Return bundles not in the given bloom-filter
Definition at line 125 of file BundleSet.cpp.
|
virtual |
Check if a specific bundle is in this bundle-set
Definition at line 105 of file BundleSet.cpp.
Referenced by dtn::routing::BaseRouter::filterKnown(), dtn::routing::BaseRouter::isKnown(), and dtn::routing::BaseRouter::isPurged().
Generates a copy of the given bundle-setCopies a bundle-set
Definition at line 89 of file BundleSet.cpp.
std::ostream & dtn::data::BundleSet::serialize | ( | std::ostream & | stream) | const |
Definition at line 140 of file BundleSet.cpp.
Referenced by dtn::data::operator<<().
|
static |
assigns the current factory for bundle-sets
Definition at line 34 of file BundleSet.cpp.
Referenced by dtn::storage::SQLiteBundleStorage::SQLiteBundleStorage(), and dtn::storage::SQLiteBundleStorage::~SQLiteBundleStorage().
|
virtual |
Returns the number of elements in this set
Definition at line 110 of file BundleSet.cpp.
void dtn::data::BundleSet::sync | ( | ) | ||
throw | ( | |||
) |
Synchronize the bundle-set with the persistent set on the disk.
Definition at line 130 of file BundleSet.cpp.
|
friend |
Definition at line 150 of file BundleSet.cpp.
|
friend |
Definition at line 155 of file BundleSet.cpp.