Classes | Public Member Functions | Protected Member Functions

dtn::core::SimpleBundleStorage Class Reference

#include <SimpleBundleStorage.h>

Inherits dtn::core::BundleStorage, dtn::core::EventReceiver, dtn::daemon::IndependentComponent, and dtn::data::BundleList.

Collaboration diagram for dtn::core::SimpleBundleStorage:
Collaboration graph
[legend]

List of all members.

Classes

class  BundleContainer
class  Task
class  TaskExpireBundles
class  TaskRemoveBundle
class  TaskStoreBundle

Public Member Functions

 SimpleBundleStorage (size_t maxsize=0)
 SimpleBundleStorage (const ibrcommon::File &workdir, size_t maxsize=0)
virtual ~SimpleBundleStorage ()
virtual void store (const dtn::data::Bundle &bundle)
virtual dtn::data::Bundle get (const dtn::data::BundleID &id)
virtual const dtn::data::MetaBundle getByDestination (const dtn::data::EID &eid, bool exact=false)
virtual const dtn::data::MetaBundle getByFilter (const ibrcommon::BloomFilter &filter)
const std::list
< dtn::data::BundleID
getList ()
void remove (const dtn::data::BundleID &id)
dtn::data::MetaBundle remove (const ibrcommon::BloomFilter &filter)
void clear ()
bool empty ()
unsigned int count ()
size_t size () const
void releaseCustody (dtn::data::BundleID &bundle)
void raiseEvent (const Event *evt)
virtual const std::string getName () const
void invokeExpiration (const size_t timestamp)

Protected Member Functions

virtual void componentUp ()
virtual void componentRun ()
virtual void componentDown ()
bool __cancellation ()
virtual void eventBundleExpired (const ExpiringBundle &b)

Detailed Description

This storage holds all bundles and fragments in the system memory.

Definition at line 30 of file SimpleBundleStorage.h.


Constructor & Destructor Documentation

dtn::core::SimpleBundleStorage::SimpleBundleStorage ( size_t  maxsize = 0  ) 

Constructor

Definition at line 21 of file SimpleBundleStorage.cpp.

dtn::core::SimpleBundleStorage::SimpleBundleStorage ( const ibrcommon::File workdir,
size_t  maxsize = 0 
)
dtn::core::SimpleBundleStorage::~SimpleBundleStorage (  )  [virtual]

Destructor

Definition at line 61 of file SimpleBundleStorage.cpp.

References ibrcommon::Queue< T >::abort(), and ibrcommon::JoinableThread::join().

Here is the call graph for this function:


Member Function Documentation

bool dtn::core::SimpleBundleStorage::__cancellation (  )  [protected]

Definition at line 100 of file SimpleBundleStorage.cpp.

References ibrcommon::Queue< T >::abort().

Here is the call graph for this function:

void dtn::core::SimpleBundleStorage::clear (  )  [virtual]
See also:
BundleStorage::clear()

Reimplemented from dtn::data::BundleList.

Definition at line 343 of file SimpleBundleStorage.cpp.

void dtn::core::SimpleBundleStorage::componentDown (  )  [protected, virtual]

Definition at line 72 of file SimpleBundleStorage.cpp.

References ibrcommon::Queue< T >::abort(), dtn::core::TimeEvent::className, and dtn::core::EventReceiver::unbindEvent().

Here is the call graph for this function:

void dtn::core::SimpleBundleStorage::componentRun (  )  [protected, virtual]

Definition at line 79 of file SimpleBundleStorage.cpp.

References ibrcommon::Queue< T >::getnpop(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, and ibrcommon::Thread::yield().

Here is the call graph for this function:

void dtn::core::SimpleBundleStorage::componentUp (  )  [protected, virtual]

Definition at line 67 of file SimpleBundleStorage.cpp.

References dtn::core::EventReceiver::bindEvent(), and dtn::core::TimeEvent::className.

Here is the call graph for this function:

unsigned int dtn::core::SimpleBundleStorage::count (  ) 
See also:
BundleStorage::count()

Definition at line 134 of file SimpleBundleStorage.cpp.

bool dtn::core::SimpleBundleStorage::empty (  ) 
See also:
BundleStorage::empty()

Definition at line 122 of file SimpleBundleStorage.cpp.

void dtn::core::SimpleBundleStorage::eventBundleExpired ( const ExpiringBundle b  )  [protected, virtual]
dtn::data::Bundle dtn::core::SimpleBundleStorage::get ( const dtn::data::BundleID id  )  [virtual]

This method returns a specific bundle which is identified by its id.

Parameters:
id The ID of the bundle to return.
Returns:
A bundle object of the

Definition at line 199 of file SimpleBundleStorage.cpp.

Referenced by dtn::routing::NeighborRoutingExtension::NeighborRoutingExtension(), and dtn::routing::StaticRoutingExtension::StaticRoutingExtension().

const dtn::data::MetaBundle dtn::core::SimpleBundleStorage::getByDestination ( const dtn::data::EID eid,
bool  exact = false 
) [virtual]

Query for a bundle with a specific destination. Set exact to true, if the application part should be compared too.

Parameters:
eid 
exact 
Returns:

Definition at line 167 of file SimpleBundleStorage.cpp.

References dtn::data::EID::getNodeEID(), dtn::data::EID::getString(), IBRCOMMON_LOGGER_DEBUG, and ibrcommon::Exception::what().

Here is the call graph for this function:

const dtn::data::MetaBundle dtn::core::SimpleBundleStorage::getByFilter ( const ibrcommon::BloomFilter filter  )  [virtual]

Returns a bundle ID which is not in the bloomfilter, but in the storage

Parameters:
filter 
Returns:

Definition at line 140 of file SimpleBundleStorage.cpp.

References dtn::core::BundleStorage::_destination_filter, ibrcommon::BloomFilter::contains(), IBRCOMMON_LOGGER_DEBUG, and ibrcommon::Exception::what().

Here is the call graph for this function:

const std::list< dtn::data::BundleID > dtn::core::SimpleBundleStorage::getList (  ) 

Returns all bundles in the storage as a list of IDs

Returns:

Definition at line 387 of file SimpleBundleStorage.cpp.

Referenced by dtn::routing::NeighborRoutingExtension::NeighborRoutingExtension(), and dtn::routing::StaticRoutingExtension::StaticRoutingExtension().

const std::string dtn::core::SimpleBundleStorage::getName (  )  const [virtual]
See also:
Component::getName()

Definition at line 117 of file SimpleBundleStorage.cpp.

void dtn::core::SimpleBundleStorage::invokeExpiration ( const size_t  timestamp  ) 

Invoke the expiration process

Parameters:
timestamp 

Definition at line 218 of file SimpleBundleStorage.cpp.

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

Here is the call graph for this function:

void dtn::core::SimpleBundleStorage::raiseEvent ( const Event evt  ) 

This method is used to receive events.

Parameters:
evt 

Definition at line 106 of file SimpleBundleStorage.cpp.

References dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), and ibrcommon::Queue< T >::push().

Here is the call graph for this function:

void dtn::core::SimpleBundleStorage::releaseCustody ( dtn::data::BundleID bundle  ) 
See also:
BundleStorage::releaseCustody();

Definition at line 128 of file SimpleBundleStorage.cpp.

dtn::data::MetaBundle dtn::core::SimpleBundleStorage::remove ( const ibrcommon::BloomFilter filter  ) 

Remove one bundles which match this filter

Parameters:
filter 
Returns:
The bundle meta data of the removed bundle.

Definition at line 306 of file SimpleBundleStorage.cpp.

References ibrcommon::BloomFilter::contains(), ibrcommon::Queue< T >::push(), and remove().

Here is the call graph for this function:

void dtn::core::SimpleBundleStorage::remove ( const dtn::data::BundleID id  ) 

This method deletes a specific bundle in the storage. No reports will be generated here.

Parameters:
id The ID of the bundle to remove.

Definition at line 276 of file SimpleBundleStorage.cpp.

References ibrcommon::Queue< T >::push().

Referenced by remove().

Here is the call graph for this function:

size_t dtn::core::SimpleBundleStorage::size (  )  const

Get the current size

Definition at line 338 of file SimpleBundleStorage.cpp.

void dtn::core::SimpleBundleStorage::store ( const dtn::data::Bundle bundle  )  [virtual]

Stores a bundle in the storage.

Parameters:
bundle The bundle to store.

Definition at line 238 of file SimpleBundleStorage.cpp.

References dtn::data::BundleList::add(), IBRCOMMON_LOGGER_DEBUG, ibrcommon::Queue< T >::push(), ibrcommon::File::size(), and dtn::data::Bundle::toString().

Here is the call graph for this function:


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