IBR-DTN  1.0.0
dtn::storage::DataStorage Class Reference

#include <DataStorage.h>

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

Classes

class  Callback
 
class  Container
 
class  DataNotAvailableException
 
class  Hash
 
class  istream
 

Public Member Functions

 DataStorage (Callback &callback, const ibrcommon::File &path, unsigned int 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 wait ()
 
void iterateAll ()
 
void reset ()
 
void setFaulty (bool mode)
 

Protected Member Functions

void run () throw ()
 
void __cancellation () throw ()
 

Detailed Description

Definition at line 41 of file DataStorage.h.

Constructor & Destructor Documentation

dtn::storage::DataStorage::DataStorage ( Callback callback,
const ibrcommon::File &  path,
unsigned int  write_buffer = 0,
bool  initialize = false 
)

Definition at line 89 of file DataStorage.cpp.

dtn::storage::DataStorage::~DataStorage ( )
virtual

Definition at line 115 of file DataStorage.cpp.

Member Function Documentation

void dtn::storage::DataStorage::__cancellation ( )
throw (
)
protected

Definition at line 198 of file DataStorage.cpp.

void dtn::storage::DataStorage::iterateAll ( )

iterate through all the data and call the iterateDataStorage() on each dataset

Definition at line 142 of file DataStorage.cpp.

References dtn::storage::DataStorage::Callback::iterateDataStorage().

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

Here is the call graph for this function:

void dtn::storage::DataStorage::remove ( const Hash hash)
void dtn::storage::DataStorage::reset ( )

reset the data storage

Definition at line 132 of file DataStorage.cpp.

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

DataStorage::istream dtn::storage::DataStorage::retrieve ( const Hash hash)
throw (DataNotAvailableException
)

Definition at line 176 of file DataStorage.cpp.

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

void dtn::storage::DataStorage::setFaulty ( bool  mode)

Set the storage to faulty. If set to true, each try to store a bundle will fail.

Definition at line 137 of file DataStorage.cpp.

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

const DataStorage::Hash dtn::storage::DataStorage::store ( DataStorage::Container data)

Definition at line 168 of file DataStorage.cpp.

Referenced by run().

void dtn::storage::DataStorage::store ( const Hash hash,
DataStorage::Container data 
)

Definition at line 159 of file DataStorage.cpp.

void dtn::storage::DataStorage::wait ( )

wait until all tasks are completed

Definition at line 193 of file DataStorage.cpp.

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


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