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

#include <BundleSet.h>

Collaboration diagram for dtn::data::BundleSet:
Collaboration graph

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

Detailed Description

Definition at line 35 of file BundleSet.h.

Constructor & Destructor Documentation

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

Creates a new bundle-set with the default bundle-set factory

Parameters
bf_sizeInitial 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

Parameters
bf_sizeInitial size fo the bloom-filter.

Definition at line 75 of file BundleSet.cpp.

dtn::data::BundleSet::~BundleSet ( )
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.

Member Function Documentation

void dtn::data::BundleSet::add ( const dtn::data::MetaBundle bundle)
throw (
)
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().

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

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

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

BundleSet & dtn::data::BundleSet::operator= ( const BundleSet other)

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<<().

void dtn::data::BundleSet::setFactory ( dtn::data::BundleSet::Factory f)
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().

Size dtn::data::BundleSet::size ( ) const
throw (
)
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.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const BundleSet obj 
)
friend

Definition at line 150 of file BundleSet.cpp.

std::istream& operator>> ( std::istream &  stream,
BundleSet obj 
)
friend

Definition at line 155 of file BundleSet.cpp.


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