ost::SharedFile(3)
π ost::SharedFile β from the Library Functions Manual (that's ost::SharedFile(3), bestie, section 3, C++ library calls, iykyk) β¨
πΈ NAME πΈ
ost::SharedFile β this class defines a database I/O file service that can be shared by multiple processes. π
π SYNOPSIS π
#include <file.h>
Inherits ost::RandomFile. Yes queen, it's giving inheritance. π
β¨ Public Member Functions β¨
SharedFile (const char *path)β open or create a new database file.SharedFile (const SharedFile &file)β create a shared file as a duplicate of an existing shared file.virtual ~SharedFile ()β close and finish a database file.Error restart (void)β restart an existing database; close and re-open.Error fetch (caddr_t address=NULL, ccxx_size_t length=0, off_t position=-1)β lock and fetch a portion of the file into physical memory.Error update (caddr_t address=NULL, ccxx_size_t length=0, off_t position=-1)β update a portion of a file from physical memory.Error clear (ccxx_size_t length=0, off_t pos=-1)β clear a lock held from a previous fetch operation without updating.Error append (caddr_t address=NULL, ccxx_size_t length=0)β add new data to the end of the file.off_t getPosition (void)β fetch the current file position marker for this thread.bool operator++ (void)bool operator-- (void)
π Additional Inherited Members π
(they're in the family tree, she's just not listing them all here π«Ά)
π Detailed Description π
This class defines a database I/O file service that can be shared by multiple processes. no cap
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. The way it just... handles the locking for you?? main character energy fr fr. π
Author
- David Sugar
dyfet@ostel.com
This class defines a database I/O file service that can be shared by multiple processes. (saying it twice because she's iconic like that β¨)
π¦ Constructor & Destructor Documentation π¦
ost::SharedFile::SharedFile (const char * path)
Open or create a new database file. You should also use Initial. πΌ
Parameters
- path β pathname of database to open.
ost::SharedFile::SharedFile (const SharedFile & file)
Create a shared file as a duplicate of an existing shared file. copy-paste but make it β¨intentionalβ¨
Parameters
- file β original file.
virtual ost::SharedFile::~SharedFile () [virtual]
Close and finish a database file. she's done, she's logging off, closing the door gently πͺπ
π Member Function Documentation π
Error ost::SharedFile::append (caddr_t address = NULL, ccxx_size_t length = 0)
Add new data to the end of the file. Locks file during append. π
Parameters
- address β address to use, or
NULLif same as last I/O. - length β length to use, or
0if same as last I/O.
Error ost::SharedFile::clear (ccxx_size_t length = 0, off_t pos = -1)
Clear a lock held from a previous fetch operation without updating. releasing the grip, respectfully π
Returns
errSuccesson success.
Parameters
- length β length to use, or
0if same as last I/O. - pos β file position to use or
-1if same as last I/O.
Error ost::SharedFile::fetch (caddr_t address = NULL, ccxx_size_t length = 0, off_t position = -1)
Lock and Fetch a portion of the file into physical memory. This can use state information to fetch the current record multiple times. π§ β¨
Returns
errSuccesson success.
Parameters
- address β address to use, or
NULLif same as last I/O. - length β length to use, or
0if same as last I/O. - position β file position to use
-1if same as last I/O.
off_t ost::SharedFile::getPosition (void)
Fetch the current file position marker for this thread. where are we? spiritually? also byte-wise. π
Returns
- file position offset.
bool ost::SharedFile::operator++ (void)
bool ost::SharedFile::operator-- (void)
(yes bestie, they're just listed. no description. not everything needs a paragraph π)
Error ost::SharedFile::restart (void) [inline], [virtual]
Restart an existing database; close and re-open. it's giving rebirth arc π¦
Returns
errSuccessif successful.
Reimplemented from ost::RandomFile.
Error ost::SharedFile::update (caddr_t address = NULL, ccxx_size_t length = 0, off_t position = -1)
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. committing AND letting go?? growth. π±
Returns
errSuccesson success.
Parameters
- address β address to use, or
NULLif same as last I/O. - length β length to use, or
0if same as last I/O. - position β file position to use or
-1if same as last I/O.
π Author π
Generated automatically by Doxygen for GNU CommonC++ from the source code. the robots wrote the docs, we just made them cute π
okay that's the whole page bestie, every flag, every default, every errSuccess, all of it β nothing skipped, nothing invented. go forth and lock some byte ranges. π«Άβ¨
GNU CommonC++ Β· Sun Dec 27 2020 Β· mwah, that's the version and date, love u, bye πππ¦πΈ
π¦ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms