IBR-DTNSuite  0.12
dtn::data::MemoryBundleSet Class Reference

#include <MemoryBundleSet.h>

Inheritance diagram for dtn::data::MemoryBundleSet:
Inheritance graph
Collaboration diagram for dtn::data::MemoryBundleSet:
Collaboration graph

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< BundleSetImplcopy () 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::BloomFiltergetBloomFilter () const throw ()
 
std::set< dtn::data::MetaBundlegetNotIn (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)
 

Detailed Description

Definition at line 38 of file MemoryBundleSet.h.

Constructor & Destructor Documentation

dtn::data::MemoryBundleSet::MemoryBundleSet ( BundleSet::Listener listener = NULL,
Length  bf_size = 1024 
)

Constructor

Parameters
listenerThis listener gets notified about expired bundles.
bf_sizeInitial 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

Parameters
nameThe identifier of the named bundle-set.
listenerThis listener gets notified about expired bundles.
bf_sizeInitial size fo the bloom-filter.

Definition at line 38 of file MemoryBundleSet.cpp.

dtn::data::MemoryBundleSet::~MemoryBundleSet ( )
virtual

Destructor

Definition at line 50 of file MemoryBundleSet.cpp.

Member Function Documentation

void dtn::data::MemoryBundleSet::add ( const dtn::data::MetaBundle bundle)
throw (
)
virtual

Add a bundle to the bundle-set

Implements dtn::data::BundleSetImpl.

Definition at line 85 of file MemoryBundleSet.cpp.

Referenced by assign(), and copy().

void dtn::data::MemoryBundleSet::assign ( const refcnt_ptr< BundleSetImpl > &  other)
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().

Here is the call graph for this function:

void dtn::data::MemoryBundleSet::clear ( )
throw (
)
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().

Here is the call graph for this function:

refcnt_ptr< BundleSetImpl > dtn::data::MemoryBundleSet::copy ( ) const
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().

Here is the call graph for this function:

std::istream & dtn::data::MemoryBundleSet::deserialize ( std::istream &  stream)
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().

Here is the call graph for this function:

void dtn::data::MemoryBundleSet::expire ( const Timestamp  timestamp)
throw (
)
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.

const ibrcommon::BloomFilter & dtn::data::MemoryBundleSet::getBloomFilter ( ) const
throw (
)
virtual

Get the bloom-filter of this bundle-set

Implements dtn::data::BundleSetImpl.

Definition at line 165 of file MemoryBundleSet.cpp.

Length dtn::data::MemoryBundleSet::getLength ( ) const
throw (
)
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().

Here is the call graph for this function:

MemoryBundleSet::bundle_set dtn::data::MemoryBundleSet::getNotIn ( const ibrcommon::BloomFilter filter) const
throw (
)
virtual

Return bundles not in the given bloom-filter

Implements dtn::data::BundleSetImpl.

Definition at line 170 of file MemoryBundleSet.cpp.

bool dtn::data::MemoryBundleSet::has ( const dtn::data::BundleID bundle) const
throw (
)
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().

Here is the call graph for this function:

std::ostream & dtn::data::MemoryBundleSet::serialize ( std::ostream &  stream) const
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().

Here is the call graph for this function:

void dtn::data::MemoryBundleSet::setPath ( const ibrcommon::File path)
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().

Here is the call graph for this function:

Size dtn::data::MemoryBundleSet::size ( ) const
throw (
)
virtual

Returns the number of elements in this set

Implements dtn::data::BundleSetImpl.

Definition at line 120 of file MemoryBundleSet.cpp.

Referenced by serialize().

void dtn::data::MemoryBundleSet::sync ( )
throw (
)
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.


The documentation for this class was generated from the following files: