|
ISLEman
|
The Store is a file based memory manager. More...
#include <store.h>
Public Member Functions | |
| Store () | |
| ~Store () | |
| int | open (const char *name) |
| portable_off_t | alloc () |
| int | write (const char *buf, uint size) |
| void | end () |
| void | release (portable_off_t handle) |
| void | close () |
| void | seek (portable_off_t handle) |
| int | read (char *buf, uint size) |
| void | printStats () |
| portable_off_t | pos () const |
| void | dumpBlock (portable_off_t start, portable_off_t end) |
Public Member Functions inherited from StorageIntf | |
| virtual | ~StorageIntf () |
The Store is a file based memory manager.
You can open the store using open(). Then obtain a handle via alloc() followed by a sequence of write() commands to store information, and finalize it using end().
Later on you locate the information with seek() using the handle obtained with alloc(), and then use a sequence of read() calls to read the information back.
If no longer needed the storage space can be freed using release().
The store will dynamically grow the file on disk if needed.
| Store::Store | ( | ) |
Creates a store.
| Store::~Store | ( | ) |
Releases the store object. Will close the underlying file if opened.
| portable_off_t Store::alloc | ( | ) |
Allocates a handle to write to and read from.
| void Store::close | ( | ) |
Closes the store
| void Store::end | ( | ) |
Ends the sequence of writes.
| int Store::open | ( | const char * | name | ) |
Opens the file underlying the store using name as the file name. Returns 0 upon success, or -1 otherwise.
|
virtual |
Reads size bytes from the store into the array pointed to be buf.
Implements StorageIntf.
| void Store::release | ( | portable_off_t | handle | ) |
Releases the memory corresponding to the handle returned with alloc()
| void Store::seek | ( | portable_off_t | handle | ) |
Goes to the start of information corresponding to handle pos
|
virtual |
Writes size bytes in array buf to the store. First alloc() has to be called.
Implements StorageIntf.
1.8.12