IBR-DTNSuite  0.10
dtn::storage::MetaStorage Class Reference

#include <MetaStorage.h>

Inheritance diagram for dtn::storage::MetaStorage:
Inheritance graph
Collaboration diagram for dtn::storage::MetaStorage:
Collaboration graph

Classes

struct  CMP_BUNDLE_PRIORITY
 

Public Types

typedef std::set
< dtn::data::MetaBundle,
CMP_BUNDLE_PRIORITY
priority_set
 
typedef priority_set::iterator iterator
 
typedef
priority_set::const_iterator 
const_iterator
 

Public Member Functions

 MetaStorage (dtn::data::BundleList::Listener &expire_listener)
 
virtual ~MetaStorage ()
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
bool empty () throw ()
 
size_t size () throw ()
 
bool has (const dtn::data::MetaBundle &m) const throw ()
 
void expire (const dtn::data::Timestamp &timestamp) throw ()
 
template<class T >
const dtn::data::MetaBundlefind (const T &id) const throw (NoBundleFoundException)
 
const dtn::data::MetaBundlefind (const ibrcommon::BloomFilter &filter) const throw (NoBundleFoundException)
 
std::set< dtn::data::EIDgetDistinctDestinations () const throw ()
 
void store (const dtn::data::MetaBundle &meta, const dtn::data::Length &space) throw ()
 
void remove (const dtn::data::MetaBundle &meta) throw ()
 
void markRemoved (const dtn::data::MetaBundle &meta) throw ()
 
bool isRemoved (const dtn::data::MetaBundle &meta) const throw ()
 
void clear () throw ()
 
dtn::data::Length getSize (const dtn::data::MetaBundle &meta) throw (NoBundleFoundException)
 
- Public Member Functions inherited from dtn::data::BundleList::Listener
virtual ~Listener ()=0
 

Protected Member Functions

virtual void eventBundleExpired (const dtn::data::MetaBundle &b) throw ()
 

Detailed Description

Definition at line 35 of file MetaStorage.h.

Member Typedef Documentation

typedef priority_set::const_iterator dtn::storage::MetaStorage::const_iterator

Definition at line 73 of file MetaStorage.h.

typedef priority_set::iterator dtn::storage::MetaStorage::iterator

Definition at line 72 of file MetaStorage.h.

Constructor & Destructor Documentation

dtn::storage::MetaStorage::MetaStorage ( dtn::data::BundleList::Listener expire_listener)

Definition at line 28 of file MetaStorage.cpp.

dtn::storage::MetaStorage::~MetaStorage ( )
virtual

Definition at line 33 of file MetaStorage.cpp.

Member Function Documentation

iterator dtn::storage::MetaStorage::begin ( )
inline
const_iterator dtn::storage::MetaStorage::begin ( ) const
inline

Definition at line 78 of file MetaStorage.h.

void dtn::storage::MetaStorage::clear ( ) throw ()

Delete all bundles

Definition at line 142 of file MetaStorage.cpp.

References dtn::data::BundleList::clear().

Referenced by dtn::storage::SimpleBundleStorage::clear(), and dtn::storage::SimpleBundleStorage::componentDown().

Here is the call graph for this function:

bool dtn::storage::MetaStorage::empty ( ) throw ()

Definition at line 127 of file MetaStorage.cpp.

References size().

Referenced by dtn::storage::SimpleBundleStorage::empty().

Here is the call graph for this function:

const_iterator dtn::storage::MetaStorage::end ( ) const
inline

Definition at line 79 of file MetaStorage.h.

void dtn::storage::MetaStorage::eventBundleExpired ( const dtn::data::MetaBundle b) throw ()
protectedvirtual

Implements dtn::data::BundleList::Listener.

Definition at line 37 of file MetaStorage.cpp.

void dtn::storage::MetaStorage::expire ( const dtn::data::Timestamp timestamp) throw ()

Definition at line 53 of file MetaStorage.cpp.

template<class T >
const dtn::data::MetaBundle& dtn::storage::MetaStorage::find ( const T &  id) const throw (NoBundleFoundException)
inline

Definition at line 88 of file MetaStorage.h.

References dtn::data::BundleList::end(), and dtn::data::BundleList::find().

Referenced by dtn::storage::SimpleBundleStorage::get(), and dtn::storage::SimpleBundleStorage::remove().

Here is the call graph for this function:

const dtn::data::MetaBundle & dtn::storage::MetaStorage::find ( const ibrcommon::BloomFilter filter) const throw (NoBundleFoundException)

Definition at line 58 of file MetaStorage.cpp.

References dtn::data::BundleID::toString().

Here is the call graph for this function:

std::set< dtn::data::EID > dtn::storage::MetaStorage::getDistinctDestinations ( ) const throw ()

Definition at line 76 of file MetaStorage.cpp.

References begin(), dtn::data::MetaBundle::destination, and end().

Referenced by dtn::storage::SimpleBundleStorage::getDistinctDestinations().

Here is the call graph for this function:

dtn::data::Length dtn::storage::MetaStorage::getSize ( const dtn::data::MetaBundle meta) throw (NoBundleFoundException)
bool dtn::storage::MetaStorage::has ( const dtn::data::MetaBundle m) const throw ()

Definition at line 47 of file MetaStorage.cpp.

bool dtn::storage::MetaStorage::isRemoved ( const dtn::data::MetaBundle meta) const throw ()

Return true, if the bundle is already marked as removed

Definition at line 122 of file MetaStorage.cpp.

Referenced by dtn::storage::SimpleBundleStorage::remove().

void dtn::storage::MetaStorage::markRemoved ( const dtn::data::MetaBundle meta) throw ()

Mark a bundle as removed. Such a bundle is still reachable using find(id) and getSize()

Definition at line 115 of file MetaStorage.cpp.

Referenced by dtn::storage::SimpleBundleStorage::remove().

void dtn::storage::MetaStorage::remove ( const dtn::data::MetaBundle meta) throw ()
dtn::data::Size dtn::storage::MetaStorage::size ( ) throw ()
void dtn::storage::MetaStorage::store ( const dtn::data::MetaBundle meta,
const dtn::data::Length space 
) throw ()

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