Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 784

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

\section{ost::Thread\-File Class Reference}
\label{classost_1_1_thread_file}\index{ost::ThreadFile@{ost::ThreadFile}}
This class defines a database I/O file service that can be shared by multiple threads.This class defines a database I/O file service that can be shared by multiple threads.  


{\tt \#include $<$file.h$>$}

Inheritance diagram for ost::Thread\-File::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3cm]{classost_1_1_thread_file}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Thread\-File} (const char $\ast$path)
\begin{CompactList}\small\item\em Open or create a new database file. \item\end{CompactList}\item 
virtual {\bf $\sim$Thread\-File} ()
\begin{CompactList}\small\item\em Close and finish a database file. \item\end{CompactList}\item 
{\bf Error} {\bf restart} (void)
\begin{CompactList}\small\item\em Restart an existing database; close and re-open. \item\end{CompactList}\item 
{\bf Error} {\bf fetch} (char $\ast$address=NULL, {\bf ccxx\_\-size\_\-t} length=0, off\_\-t position=-1)
\begin{CompactList}\small\item\em Fetch a portion of the file into physical memory. \item\end{CompactList}\item 
{\bf Error} {\bf update} (char $\ast$address=NULL, {\bf ccxx\_\-size\_\-t} length=0, off\_\-t position=-1)
\begin{CompactList}\small\item\em Update a portion of a file from physical memory. \item\end{CompactList}\item 
{\bf Error} {\bf append} (char $\ast$address=NULL, {\bf ccxx\_\-size\_\-t} length=0)
\begin{CompactList}\small\item\em Add new data to the end of the file. \item\end{CompactList}\item 
off\_\-t {\bf get\-Position} (void)
\begin{CompactList}\small\item\em Fetch the current file position marker for this thread. \item\end{CompactList}\item 
bool {\bf operator++} (void)
\item 
bool {\bf operator--} (void)
\end{CompactItemize}


\subsection{Detailed Description}
This class defines a database I/O file service that can be shared by multiple threads.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.

{\bf Thread\-File}{\rm (p.\,\pageref{classost_1_1_thread_file})} 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 \char`\"{}fcb\char`\"{} structure is used to hold file \char`\"{}state\char`\"{}, and pread/pwrite is used whenever possible for optimized I/O. On systems that do not offer pwread/pwrite, a {\bf Mutex}{\rm (p.\,\pageref{classost_1_1_mutex})} lock is used to protect concurrent lseek and read/write operations. {\bf Thread\-File}{\rm (p.\,\pageref{classost_1_1_thread_file})} managed databases are assumed to be used only by the local server and through a single file descriptor.

\begin{Desc}
\item[Author:]David Sugar $<${\tt dyfet@ostel.com}$>$ \end{Desc}




\subsection{Constructor \& Destructor Documentation}
\index{ost::ThreadFile@{ost::Thread\-File}!ThreadFile@{ThreadFile}}
\index{ThreadFile@{ThreadFile}!ost::ThreadFile@{ost::Thread\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Thread\-File::Thread\-File (const char $\ast$ {\em path})}\label{classost_1_1_thread_file_17e345a69a04ba5b9db9c556925900c1}


Open or create a new database file. 

You should also use Initial.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em path}]pathname of database to open. \end{description}
\end{Desc}
\index{ost::ThreadFile@{ost::Thread\-File}!~ThreadFile@{$\sim$ThreadFile}}
\index{~ThreadFile@{$\sim$ThreadFile}!ost::ThreadFile@{ost::Thread\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ost::Thread\-File::$\sim$Thread\-File ()\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_thread_file_ebf1b7d1658ad10654425eadd1a34052}


Close and finish a database file. 



\subsection{Member Function Documentation}
\index{ost::ThreadFile@{ost::Thread\-File}!append@{append}}
\index{append@{append}!ost::ThreadFile@{ost::Thread\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Thread\-File::append (char $\ast$ {\em address} = {\tt NULL}, {\bf ccxx\_\-size\_\-t} {\em length} = {\tt 0})}\label{classost_1_1_thread_file_0dd1a865c7936e01f3082b216925f418}


Add new data to the end of the file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em address}]address to use, or NULL if same as last I/O. \item[{\em length}]length to use, or 0 if same as last I/O. \end{description}
\end{Desc}
\index{ost::ThreadFile@{ost::Thread\-File}!fetch@{fetch}}
\index{fetch@{fetch}!ost::ThreadFile@{ost::Thread\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Thread\-File::fetch (char $\ast$ {\em address} = {\tt NULL}, {\bf ccxx\_\-size\_\-t} {\em length} = {\tt 0}, off\_\-t {\em position} = {\tt -1})}\label{classost_1_1_thread_file_3f4dae2704c3780ebccf6abd1f3bc021}


Fetch a portion of the file into physical memory. 

This can use state information to fetch the current record multiple times.

\begin{Desc}
\item[Returns:]err\-Success on success. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em address}]address to use, or NULL if same as last I/O. \item[{\em length}]length to use, or 0 if same as last I/O. \item[{\em position}]file position to use -1 if same as last I/O. \end{description}
\end{Desc}
\index{ost::ThreadFile@{ost::Thread\-File}!getPosition@{getPosition}}
\index{getPosition@{getPosition}!ost::ThreadFile@{ost::Thread\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}off\_\-t ost::Thread\-File::get\-Position (void)}\label{classost_1_1_thread_file_09adee0b9978cdc82435c901c850d4e5}


Fetch the current file position marker for this thread. 

\begin{Desc}
\item[Returns:]file position offset. \end{Desc}
\index{ost::ThreadFile@{ost::Thread\-File}!operator++@{operator++}}
\index{operator++@{operator++}!ost::ThreadFile@{ost::Thread\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Thread\-File::operator++ (void)}\label{classost_1_1_thread_file_5587d9a579902aa4589ec1777fecd2f6}


\index{ost::ThreadFile@{ost::Thread\-File}!operator--@{operator--}}
\index{operator--@{operator--}!ost::ThreadFile@{ost::Thread\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Thread\-File::operator-- (void)}\label{classost_1_1_thread_file_48627c57443c979420e3b218f387cff0}


\index{ost::ThreadFile@{ost::Thread\-File}!restart@{restart}}
\index{restart@{restart}!ost::ThreadFile@{ost::Thread\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Thread\-File::restart (void)\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_thread_file_634eeae5f8e783d26e484046344a0556}


Restart an existing database; close and re-open. 

\begin{Desc}
\item[Returns:]err\-Success if successful. \end{Desc}


Reimplemented from {\bf ost::Random\-File} {\rm (p.\,\pageref{classost_1_1_random_file_e78c71b1e3fab5861bc9fdae595829a7})}.\index{ost::ThreadFile@{ost::Thread\-File}!update@{update}}
\index{update@{update}!ost::ThreadFile@{ost::Thread\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Error} ost::Thread\-File::update (char $\ast$ {\em address} = {\tt NULL}, {\bf ccxx\_\-size\_\-t} {\em length} = {\tt 0}, off\_\-t {\em position} = {\tt -1})}\label{classost_1_1_thread_file_aa50dd7107aa5384b8536316803bcd11}


Update a portion of a file from physical memory. 

This can use state information to commit the last read record.

\begin{Desc}
\item[Returns:]err\-Success on success. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em address}]address to use, or NULL if same as last I/O. \item[{\em length}]length to use, or 0 if same as last I/O. \item[{\em position}]file position to use or -1 if same as last I/O. \end{description}
\end{Desc}


The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
{\bf file.h}\end{CompactItemize}