Rechercher une page de manuel
ost_ThreadFile
Langue: en
Version: 355168 (ubuntu - 24/10/10)
Section: 3 (Bibliothèques de fonctions)
Sommaire
- NAME
- SYNOPSIS
- Detailed Description
- Constructor & Destructor Documentation
- Member Function Documentation
- Error ost::ThreadFile::append (char * address = NULL, ccxx_size_t length = 0)
- Error ost::ThreadFile::fetch (char * address = NULL, ccxx_size_t length = 0, off_t position = -1)
- off_t ost::ThreadFile::getPosition (void)
- bool ost::ThreadFile::operator++ (void)
- bool ost::ThreadFile::operator-- (void)
- Error ost::ThreadFile::restart (void) [virtual]
- Error ost::ThreadFile::update (char * address = NULL, ccxx_size_t length = 0, off_t position = -1)
- Author
NAME
ost::ThreadFile -This class defines a database I/O file service that can be shared by multiple threads.
SYNOPSIS
#include <file.h>
Inherits ost::RandomFile.
Public Member Functions
ThreadFile (const char *path)
Open or create a new database file.
virtual ~ThreadFile ()
Close and finish a database file.
Error restart (void)
Restart an existing database; close and re-open.
Error fetch (char *address=NULL, ccxx_size_t length=0, off_t position=-1)
Fetch a portion of the file into physical memory.
Error update (char *address=NULL, ccxx_size_t length=0, off_t position=-1)
Update a portion of a file from physical memory.
Error append (char *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)
Detailed Description
This class defines a database I/O file service that can be shared by multiple threads.
All threads access a global copy of the database object, and mutex locks can be used to preserve transaction integrety. pread/pwrite calls can be used for optimized I/O when supported.
ThreadFile is meant for use by a threaded database server where multiple threads may each perform semi-independent operations on a given database table stored on disk. A special 'fcb' structure is used to hold file 'state', and pread/pwrite is used whenever possible for optimized I/O. On systems that do not offer pwread/pwrite, a Mutex lock is used to protect concurrent lseek and read/write operations. ThreadFile managed databases are assumed to be used only by the local server and through a single file descriptor.
Author:
- David Sugar <dyfet@ostel.com> This class defines a database I/O file service that can be shared by multiple threads.
Constructor & Destructor Documentation
ost::ThreadFile::ThreadFile (const char * path)
Open or create a new database file. You should also use Initial.
Parameters:
- path pathname of database to open.
virtual ost::ThreadFile::~ThreadFile () [virtual]
Close and finish a database file.
Member Function Documentation
Error ost::ThreadFile::append (char * address = NULL, ccxx_size_t length = 0)
Add new data to the end of the file. Parameters:
- address address to use, or NULL if same as last I/O.
length length to use, or 0 if same as last I/O.
Error ost::ThreadFile::fetch (char * address = NULL, ccxx_size_t length = 0, off_t position = -1)
Fetch a portion of the file into physical memory. This can use state information to fetch the current record multiple times.
Returns:
- errSuccess on success.
Parameters:
- address address to use, or NULL if same as last I/O.
length length to use, or 0 if same as last I/O.
position file position to use -1 if same as last I/O.
off_t ost::ThreadFile::getPosition (void)
Fetch the current file position marker for this thread. Returns:
- file position offset.
bool ost::ThreadFile::operator++ (void)
bool ost::ThreadFile::operator-- (void)
Error ost::ThreadFile::restart (void) [virtual]
Restart an existing database; close and re-open. Returns:
- errSuccess if successful.
Reimplemented from ost::RandomFile.
Error ost::ThreadFile::update (char * 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.
Returns:
- errSuccess on success.
Parameters:
- address address to use, or NULL if same as last I/O.
length length to use, or 0 if same as last I/O.
position file position to use or -1 if same as last I/O.
Author
Generated automatically by Doxygen for GNU CommonC++ from the source code.
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre