.TH "ost::SharedFile" 3 "Sun Dec 27 2020" "GNU CommonC++" \" -*- nroff -*- .ad l .nh .SH NAME ost::SharedFile \- This class defines a database I/O file service that can be shared by multiple processes\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBost::RandomFile\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSharedFile\fP (const char *path)" .br .RI "Open or create a new database file\&. " .ti -1c .RI "\fBSharedFile\fP (const \fBSharedFile\fP &file)" .br .RI "Create a shared file as a duplicate of an existing shared file\&. " .ti -1c .RI "virtual \fB~SharedFile\fP ()" .br .RI "Close and finish a database file\&. " .ti -1c .RI "\fBError\fP \fBrestart\fP (void)" .br .RI "Restart an existing database; close and re-open\&. " .ti -1c .RI "\fBError\fP \fBfetch\fP (caddr_t address=NULL, \fBccxx_size_t\fP length=0, off_t position=\-1)" .br .RI "Lock and Fetch a portion of the file into physical memory\&. " .ti -1c .RI "\fBError\fP \fBupdate\fP (caddr_t address=NULL, \fBccxx_size_t\fP length=0, off_t position=\-1)" .br .RI "Update a portion of a file from physical memory\&. " .ti -1c .RI "\fBError\fP \fBclear\fP (\fBccxx_size_t\fP length=0, off_t pos=\-1)" .br .RI "Clear a lock held from a previous fetch operation without updating\&. " .ti -1c .RI "\fBError\fP \fBappend\fP (caddr_t address=NULL, \fBccxx_size_t\fP length=0)" .br .RI "Add new data to the end of the file\&. " .ti -1c .RI "off_t \fBgetPosition\fP (void)" .br .RI "Fetch the current file position marker for this thread\&. " .ti -1c .RI "bool \fBoperator++\fP (void)" .br .ti -1c .RI "bool \fBoperator\-\-\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP This class defines a database I/O file service that can be shared by multiple processes\&. 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\&. .PP \fBSharedFile\fP is used when a database may be shared between multiple processes\&. \fBSharedFile\fP automatically applies low level byte-range 'file locks', and provides an interface to fetch and release byte-range locked portions of a file\&. .PP \fBAuthor\fP .RS 4 David Sugar dyfet@ostel.com .RE .PP This class defines a database I/O file service that can be shared by multiple processes\&. .SH "Constructor & Destructor Documentation" .PP .SS "ost::SharedFile::SharedFile (const char * path)" .PP Open or create a new database file\&. You should also use Initial\&. .PP \fBParameters\fP .RS 4 \fIpath\fP pathname of database to open\&. .RE .PP .SS "ost::SharedFile::SharedFile (const \fBSharedFile\fP & file)" .PP Create a shared file as a duplicate of an existing shared file\&. .PP \fBParameters\fP .RS 4 \fIfile\fP original file\&. .RE .PP .SS "virtual ost::SharedFile::~SharedFile ()\fC [virtual]\fP" .PP Close and finish a database file\&. .SH "Member Function Documentation" .PP .SS "\fBError\fP ost::SharedFile::append (caddr_t address = \fCNULL\fP, \fBccxx_size_t\fP length = \fC0\fP)" .PP Add new data to the end of the file\&. Locks file during append\&. .PP \fBParameters\fP .RS 4 \fIaddress\fP address to use, or NULL if same as last I/O\&. .br \fIlength\fP length to use, or 0 if same as last I/O\&. .RE .PP .SS "\fBError\fP ost::SharedFile::clear (\fBccxx_size_t\fP length = \fC0\fP, off_t pos = \fC\-1\fP)" .PP Clear a lock held from a previous fetch operation without updating\&. .PP \fBReturns\fP .RS 4 errSuccess on success\&. .RE .PP \fBParameters\fP .RS 4 \fIlength\fP length to use, or 0 if same as last I/O\&. .br \fIpos\fP file position to use or -1 if same as last I/O\&. .RE .PP .SS "\fBError\fP ost::SharedFile::fetch (caddr_t address = \fCNULL\fP, \fBccxx_size_t\fP length = \fC0\fP, off_t position = \fC\-1\fP)" .PP Lock and Fetch a portion of the file into physical memory\&. This can use state information to fetch the current record multiple times\&. .PP \fBReturns\fP .RS 4 errSuccess on success\&. .RE .PP \fBParameters\fP .RS 4 \fIaddress\fP address to use, or NULL if same as last I/O\&. .br \fIlength\fP length to use, or 0 if same as last I/O\&. .br \fIposition\fP file position to use -1 if same as last I/O\&. .RE .PP .SS "off_t ost::SharedFile::getPosition (void)" .PP Fetch the current file position marker for this thread\&. .PP \fBReturns\fP .RS 4 file position offset\&. .RE .PP .SS "bool ost::SharedFile::operator++ (void)" .SS "bool ost::SharedFile::operator\-\- (void)" .SS "\fBError\fP ost::SharedFile::restart (void)\fC [inline]\fP, \fC [virtual]\fP" .PP Restart an existing database; close and re-open\&. .PP \fBReturns\fP .RS 4 errSuccess if successful\&. .RE .PP .PP Reimplemented from \fBost::RandomFile\fP\&. .SS "\fBError\fP ost::SharedFile::update (caddr_t address = \fCNULL\fP, \fBccxx_size_t\fP length = \fC0\fP, off_t position = \fC\-1\fP)" .PP 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\&. .PP \fBReturns\fP .RS 4 errSuccess on success\&. .RE .PP \fBParameters\fP .RS 4 \fIaddress\fP address to use, or NULL if same as last I/O\&. .br \fIlength\fP length to use, or 0 if same as last I/O\&. .br \fIposition\fP file position to use or -1 if same as last I/O\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for GNU CommonC++ from the source code\&.