IBR-DTNSuite
0.8
|
#include <DataStorage.h>
Classes | |
class | Callback |
class | Container |
class | DataNotAvailableException |
class | Hash |
class | istream |
class | RemoveDataTask |
class | StoreDataTask |
class | Task |
Public Member Functions | |
DataStorage (Callback &callback, const ibrcommon::File &path, size_t write_buffer=0, bool initialize=false) | |
virtual | ~DataStorage () |
const Hash | store (Container *data) |
void | store (const Hash &hash, Container *data) |
DataStorage::istream | retrieve (const Hash &hash) throw (DataNotAvailableException) |
void | remove (const Hash &hash) |
void | iterateAll () |
Protected Member Functions | |
void | run () |
void | __cancellation () |
Definition at line 25 of file DataStorage.h.
dtn::storage::DataStorage::DataStorage | ( | Callback & | callback, |
const ibrcommon::File & | path, | ||
size_t | write_buffer = 0 , |
||
bool | initialize = false |
||
) |
Definition at line 79 of file DataStorage.cpp.
References ibrcommon::File::createDirectory(), ibrcommon::File::exists(), and ibrcommon::File::getFiles().
dtn::storage::DataStorage::~DataStorage | ( | ) | [virtual] |
Definition at line 105 of file DataStorage.cpp.
References ibrcommon::Queue< T >::abort(), ibrcommon::Queue< T >::getnpop(), and ibrcommon::JoinableThread::join().
void dtn::storage::DataStorage::__cancellation | ( | ) | [protected, virtual] |
Implements ibrcommon::Thread.
Definition at line 173 of file DataStorage.cpp.
References ibrcommon::Queue< T >::abort().
Definition at line 122 of file DataStorage.cpp.
References ibrcommon::File::getFiles(), and dtn::storage::DataStorage::Callback::iterateDataStorage().
Referenced by dtn::storage::SimpleBundleStorage::SimpleBundleStorage().
void dtn::storage::DataStorage::remove | ( | const Hash & | hash | ) |
Definition at line 168 of file DataStorage.cpp.
References ibrcommon::Queue< T >::push().
Referenced by dtn::storage::SimpleBundleStorage::clear(), dtn::storage::SimpleBundleStorage::eventBundleExpired(), dtn::storage::SimpleBundleStorage::iterateDataStorage(), and dtn::storage::SimpleBundleStorage::remove().
DataStorage::istream dtn::storage::DataStorage::retrieve | ( | const Hash & | hash | ) | throw (DataNotAvailableException) |
Definition at line 156 of file DataStorage.cpp.
References ibrcommon::File::exists(), and ibrcommon::File::get().
void dtn::storage::DataStorage::run | ( | ) | [protected, virtual] |
Abstract interface for thread context run method.
Implements ibrcommon::Thread.
Definition at line 178 of file DataStorage.cpp.
References dtn::storage::DataStorage::Callback::eventDataStorageRemoved(), dtn::storage::DataStorage::Callback::eventDataStorageRemoveFailed(), dtn::storage::DataStorage::Callback::eventDataStorageStored(), dtn::storage::DataStorage::Callback::eventDataStorageStoreFailed(), ibrcommon::File::exists(), ibrcommon::File::get(), ibrcommon::Queue< T >::getnpop(), ibrcommon::File::getPath(), ibrcommon::Semaphore::post(), ibrcommon::File::remove(), and store().
const DataStorage::Hash dtn::storage::DataStorage::store | ( | DataStorage::Container * | data | ) |
Definition at line 148 of file DataStorage.cpp.
Referenced by run(), and dtn::storage::SimpleBundleStorage::store().
void dtn::storage::DataStorage::store | ( | const Hash & | hash, |
DataStorage::Container * | data | ||
) |
Definition at line 139 of file DataStorage.cpp.
References ibrcommon::Queue< T >::push(), and ibrcommon::Semaphore::wait().