#include <file.h>
Inheritance diagram for SharedFile::
Public Methods | |
SharedFile (const char *path) | |
Open or create a new database file. More... | |
SharedFile (const SharedFile &file) | |
Create a shared file as a duplicate of an existing shared file. More... | |
virtual | ~SharedFile () |
Close and finish a database file. More... | |
fileerror_t | Restart (void) |
Restart an existing database; close and re-open. More... | |
fileerror_t | Fetch (char *address=NULL, ccxx_size_t length=0, off_t position=-1) |
Lock and Fetch a portion of the file into physical memory. More... | |
fileerror_t | Update (char *address=NULL, ccxx_size_t length=0, off_t position=-1) |
Update a portion of a file from physical memory. More... | |
fileerror_t | Clear (ccxx_size_t length=0, off_t pos=-1) |
Clear a lock held from a previous fetch operation without updating. More... | |
fileerror_t | Append (char *address=NULL, ccxx_size_t length=0) |
Add new data to the end of the file. More... | |
off_t | getPosition (void) |
Fetch the current file position marker for this thread. More... | |
bool | operator++ (void) |
bool | operator-- (void) |
Each thread should access a dup of the database object, and mutex locks can be used to preserve transaction integrety if multiple threads are used.
SharedFile is used when a database may be shared between multiple processes. SharedFile automatically applies low level byte-range "file locks", and provides an interface to fetch and release byte-range locked portions of a file.
|
Open or create a new database file. You should also use Initial.
|
|
Create a shared file as a duplicate of an existing shared file.
|
|
Close and finish a database file.
|
|
Add new data to the end of the file. Locks file during append.
|
|
Clear a lock held from a previous fetch operation without updating.
|
|
Lock and Fetch a portion of the file into physical memory. This can use state information to fetch the current record multiple times.
|
|
Restart an existing database; close and re-open.
Reimplemented from RandomFile. |
|
Update a portion of a file from physical memory. This can use state information to commit the last read record. The current lock is also cleared.
|
|
Fetch the current file position marker for this thread.
|
|
|
|
|