IBR-DTNSuite
0.8
|
#include <MemoryBundleStorage.h>
Classes | |
struct | CMP_BUNDLE_PRIORITY |
Public Member Functions | |
MemoryBundleStorage (size_t maxsize=0) | |
virtual | ~MemoryBundleStorage () |
virtual void | store (const dtn::data::Bundle &bundle) |
virtual dtn::data::Bundle | get (const dtn::data::BundleID &id) |
virtual const std::list < dtn::data::MetaBundle > | get (BundleFilterCallback &cb) |
virtual const std::set < dtn::data::EID > | getDistinctDestinations () |
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 (const dtn::data::EID &custodian, const dtn::data::BundleID &id) |
void | raiseEvent (const dtn::core::Event *evt) |
virtual const std::string | getName () const |
Protected Member Functions | |
virtual void | componentUp () |
virtual void | componentDown () |
virtual void | eventBundleExpired (const ExpiringBundle &b) |
Definition at line 24 of file MemoryBundleStorage.h.
dtn::storage::MemoryBundleStorage::MemoryBundleStorage | ( | size_t | maxsize = 0 | ) |
Definition at line 21 of file MemoryBundleStorage.cpp.
dtn::storage::MemoryBundleStorage::~MemoryBundleStorage | ( | ) | [virtual] |
Definition at line 26 of file MemoryBundleStorage.cpp.
void dtn::storage::MemoryBundleStorage::clear | ( | ) | [virtual] |
Reimplemented from dtn::data::BundleList.
Definition at line 239 of file MemoryBundleStorage.cpp.
void dtn::storage::MemoryBundleStorage::componentDown | ( | ) | [protected, virtual] |
Implements dtn::daemon::IntegratedComponent.
Definition at line 35 of file MemoryBundleStorage.cpp.
References dtn::core::TimeEvent::className, and dtn::core::EventReceiver::unbindEvent().
void dtn::storage::MemoryBundleStorage::componentUp | ( | ) | [protected, virtual] |
Implements dtn::daemon::IntegratedComponent.
Definition at line 30 of file MemoryBundleStorage.cpp.
References dtn::core::EventReceiver::bindEvent(), and dtn::core::TimeEvent::className.
unsigned int dtn::storage::MemoryBundleStorage::count | ( | ) | [virtual] |
Reimplemented from dtn::storage::BundleStorage.
Definition at line 70 of file MemoryBundleStorage.cpp.
bool dtn::storage::MemoryBundleStorage::empty | ( | ) | [virtual] |
Reimplemented from dtn::storage::BundleStorage.
Definition at line 58 of file MemoryBundleStorage.cpp.
void dtn::storage::MemoryBundleStorage::eventBundleExpired | ( | const ExpiringBundle & | b | ) | [protected, virtual] |
Reimplemented from dtn::data::BundleList.
Definition at line 252 of file MemoryBundleStorage.cpp.
References dtn::data::BundleList::ExpiringBundle::bundle, dtn::core::BUNDLE_DELETED, dtn::data::StatusReportBlock::LIFETIME_EXPIRED, dtn::core::BundleExpiredEvent::raise(), and dtn::core::BundleEvent::raise().
dtn::data::Bundle dtn::storage::MemoryBundleStorage::get | ( | const dtn::data::BundleID & | id | ) | [virtual] |
This method returns a specific bundle which is identified by its id.
id | The ID of the bundle to return. |
Implements dtn::storage::BundleStorage.
Definition at line 97 of file MemoryBundleStorage.cpp.
References IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, and ibrcommon::Exception::what().
const std::list< dtn::data::MetaBundle > dtn::storage::MemoryBundleStorage::get | ( | BundleFilterCallback & | cb | ) | [virtual] |
Implements dtn::storage::BundleStorage.
Definition at line 76 of file MemoryBundleStorage.cpp.
References dtn::storage::BundleStorage::BundleFilterCallback::limit(), and dtn::storage::BundleStorage::BundleFilterCallback::shouldAdd().
const std::set< dtn::data::EID > dtn::storage::MemoryBundleStorage::getDistinctDestinations | ( | ) | [virtual] |
Implements dtn::storage::BundleStorage.
Definition at line 123 of file MemoryBundleStorage.cpp.
References dtn::data::PrimaryBlock::_destination, and dtn::data::Bundle::insert().
const std::string dtn::storage::MemoryBundleStorage::getName | ( | ) | const [virtual] |
Implements dtn::daemon::Component.
Definition at line 53 of file MemoryBundleStorage.cpp.
void dtn::storage::MemoryBundleStorage::raiseEvent | ( | const dtn::core::Event * | evt | ) | [virtual] |
This method is used to receive events.
evt |
Implements dtn::core::EventReceiver.
Definition at line 40 of file MemoryBundleStorage.cpp.
References dtn::data::BundleList::expire(), dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), and dtn::core::TIME_SECOND_TICK.
void dtn::storage::MemoryBundleStorage::releaseCustody | ( | const dtn::data::EID & | custodian, |
const dtn::data::BundleID & | id | ||
) | [virtual] |
Implements dtn::storage::BundleStorage.
Definition at line 64 of file MemoryBundleStorage.cpp.
void dtn::storage::MemoryBundleStorage::remove | ( | const dtn::data::BundleID & | id | ) | [virtual] |
This method deletes a specific bundle in the storage. No reports will be generated here.
id | The ID of the bundle to remove. |
Implements dtn::storage::BundleStorage.
Definition at line 170 of file MemoryBundleStorage.cpp.
References dtn::data::DefaultSerializer::getLength(), and size().
Referenced by remove().
dtn::data::MetaBundle dtn::storage::MemoryBundleStorage::remove | ( | const ibrcommon::BloomFilter & | filter | ) | [virtual] |
Remove one bundles which match this filter
filter |
Reimplemented from dtn::storage::BundleStorage.
Definition at line 202 of file MemoryBundleStorage.cpp.
References ibrcommon::BloomFilter::contains(), remove(), and dtn::data::Bundle::toString().
size_t dtn::storage::MemoryBundleStorage::size | ( | ) | const |
Get the current size
Definition at line 234 of file MemoryBundleStorage.cpp.
void dtn::storage::MemoryBundleStorage::store | ( | const dtn::data::Bundle & | bundle | ) | [virtual] |
Stores a bundle in the storage.
bundle | The bundle to store. |
Implements dtn::storage::BundleStorage.
Definition at line 138 of file MemoryBundleStorage.cpp.
References dtn::data::BundleList::add(), dtn::data::DefaultSerializer::getLength(), IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, size(), and dtn::data::Bundle::toString().