|
| drwnPersistentStorageBuffer (const char *fileStem, bool bCompressed=false) |
|
size_t | size () const |
| returns number of records in the buffer
|
|
size_t | memory () const |
| returns memory used by in-memory records
|
|
const drwnPersistentStorage & | storage () const |
| returns a reference to the storage object
|
|
drwnSmartPointer< T > | read (const string &key) |
| returns a record from the in-memory buffer or disk storage
|
|
void | write (const string &key, drwnSmartPointer< T > &p) |
| writes a record to storage (the write is delayed until the record is removed from memory or flush is called)
|
|
void | erase (const string &key) |
| erases a record from storage (and memory)
|
|
void | flush () |
| write all pending records to disk
|
|
template<class T>
class drwnPersistentStorageBuffer< T >
Provides buffered storage (delayed write-back) of objects with a drwnPersistentRecord interface.
Records are removed in least-recently-used order.
- Warning
- The API for this class may change in future versions.
-
The class is not thread-safe.
- Todo:
- rename to drwnPersistentRecordBuffer