Sophie

Sophie

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

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

\section{ost::Sys\-Time Class Reference}
\label{classost_1_1_sys_time}\index{ost::SysTime@{ost::SysTime}}
This class is used to access non-reentrant date and time functions in the standard C {\bf library.Thread}{\rm (p.\,\pageref{namespaceost_1a3b6738f6f759fcb52b544a4787cbb2})} safe date and time functions.  


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

\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static time\_\-t {\bf get\-Time} (time\_\-t $\ast$tloc=NULL)
\item 
static time\_\-t {\bf time} (time\_\-t $\ast$tloc)
\item 
static int {\bf get\-Time\-Of\-Day} (struct timeval $\ast$tp)
\item 
static int {\bf gettimeofday} (struct timeval $\ast$tp, struct timezone $\ast$)
\item 
static struct tm $\ast$ {\bf get\-Local\-Time} (const time\_\-t $\ast$clock, struct tm $\ast$result)
\item 
static struct tm $\ast$ {\bf locatime} (const time\_\-t $\ast$clock, struct tm $\ast$result)
\item 
static struct tm $\ast$ {\bf get\-GMTTime} (const time\_\-t $\ast$clock, struct tm $\ast$result)
\item 
static struct tm $\ast$ {\bf gmtime} (const time\_\-t $\ast$clock, struct tm $\ast$result)
\end{CompactItemize}
\subsection*{Static Protected Member Functions}
\begin{CompactItemize}
\item 
static void {\bf lock} (void)
\item 
static void {\bf unlock} (void)
\end{CompactItemize}


\subsection{Detailed Description}
This class is used to access non-reentrant date and time functions in the standard C {\bf library.Thread}{\rm (p.\,\pageref{namespaceost_1a3b6738f6f759fcb52b544a4787cbb2})} safe date and time functions. 

The class has two purposes:\begin{itemize}
\item 1 To be used internaly in Common\-Cpp's date and time classes to make them thread safe.\item 2 To be used by clients as thread safe replacements to the standard C functions, much like {\bf Thread::sleep()}{\rm (p.\,\pageref{classost_1_1_thread_663d960e8599194f3b25169915c22fb6})} represents a thread safe version of the standard sleep() function.\end{itemize}


\begin{Desc}
\item[Note:]The class provides one function with the same name as its equivalent standard function and one with another, unique name. For new clients, the version with the unique name is recommended to make it easy to grep for accidental usage of the standard functions. The version with the standard name is provided for existing clients to sed replace their original version.

Also note that some functions that returned pointers have been redone to take that pointer as an argument instead, making the caller responsible for memory allocation/deallocation. This is almost how POSIX specifies $\ast$\_\-r functions (reentrant versions of the standard time functions), except the POSIX functions also return the given pointer while we do not. We don't use the $\ast$\_\-r functions as they aren't all generally available on all platforms yet.\end{Desc}
\begin{Desc}
\item[Author:]Idar Tollefsen $<${\tt idar@cognita.no}$>$ \end{Desc}




\subsection{Member Function Documentation}
\index{ost::SysTime@{ost::Sys\-Time}!getGMTTime@{getGMTTime}}
\index{getGMTTime@{getGMTTime}!ost::SysTime@{ost::Sys\-Time}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static struct tm$\ast$ ost::Sys\-Time::get\-GMTTime (const time\_\-t $\ast$ {\em clock}, struct tm $\ast$ {\em result})\hspace{0.3cm}{\tt  [static]}}\label{classost_1_1_sys_time_0da1e5fefac7161a878daed011e79932}


\index{ost::SysTime@{ost::Sys\-Time}!getLocalTime@{getLocalTime}}
\index{getLocalTime@{getLocalTime}!ost::SysTime@{ost::Sys\-Time}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static struct tm$\ast$ ost::Sys\-Time::get\-Local\-Time (const time\_\-t $\ast$ {\em clock}, struct tm $\ast$ {\em result})\hspace{0.3cm}{\tt  [static]}}\label{classost_1_1_sys_time_c39180f2c7b282d0145134d14a288480}


\index{ost::SysTime@{ost::Sys\-Time}!getTime@{getTime}}
\index{getTime@{getTime}!ost::SysTime@{ost::Sys\-Time}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static time\_\-t ost::Sys\-Time::get\-Time (time\_\-t $\ast$ {\em tloc} = {\tt NULL})\hspace{0.3cm}{\tt  [static]}}\label{classost_1_1_sys_time_ab5bc338259759c47df084065f6b605c}


\index{ost::SysTime@{ost::Sys\-Time}!gettimeofday@{gettimeofday}}
\index{gettimeofday@{gettimeofday}!ost::SysTime@{ost::Sys\-Time}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static int ost::Sys\-Time::gettimeofday (struct timeval $\ast$ {\em tp}, struct timezone $\ast$)\hspace{0.3cm}{\tt  [inline, static]}}\label{classost_1_1_sys_time_fc403fcaa5a8ebf81528a34e5d5a1fac}


\index{ost::SysTime@{ost::Sys\-Time}!getTimeOfDay@{getTimeOfDay}}
\index{getTimeOfDay@{getTimeOfDay}!ost::SysTime@{ost::Sys\-Time}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static int ost::Sys\-Time::get\-Time\-Of\-Day (struct timeval $\ast$ {\em tp})\hspace{0.3cm}{\tt  [static]}}\label{classost_1_1_sys_time_9b0387c29a0a79395b7f38dae4ade533}


\index{ost::SysTime@{ost::Sys\-Time}!gmtime@{gmtime}}
\index{gmtime@{gmtime}!ost::SysTime@{ost::Sys\-Time}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static struct tm$\ast$ ost::Sys\-Time::gmtime (const time\_\-t $\ast$ {\em clock}, struct tm $\ast$ {\em result})\hspace{0.3cm}{\tt  [inline, static]}}\label{classost_1_1_sys_time_1852b1563a7b8f2b96ab75bafe3948eb}


\index{ost::SysTime@{ost::Sys\-Time}!locatime@{locatime}}
\index{locatime@{locatime}!ost::SysTime@{ost::Sys\-Time}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static struct tm$\ast$ ost::Sys\-Time::locatime (const time\_\-t $\ast$ {\em clock}, struct tm $\ast$ {\em result})\hspace{0.3cm}{\tt  [inline, static]}}\label{classost_1_1_sys_time_f4bd7e44705486a2f0cee2cb98b2f975}


\index{ost::SysTime@{ost::Sys\-Time}!lock@{lock}}
\index{lock@{lock}!ost::SysTime@{ost::Sys\-Time}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static void ost::Sys\-Time::lock (void)\hspace{0.3cm}{\tt  [inline, static, protected]}}\label{classost_1_1_sys_time_9c5b33e9cabc7f1510653dbd1f6eb0ae}


\index{ost::SysTime@{ost::Sys\-Time}!time@{time}}
\index{time@{time}!ost::SysTime@{ost::Sys\-Time}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static time\_\-t ost::Sys\-Time::time (time\_\-t $\ast$ {\em tloc})\hspace{0.3cm}{\tt  [inline, static]}}\label{classost_1_1_sys_time_ccb0dc3c9d64b224e47649211dbe7b64}


\index{ost::SysTime@{ost::Sys\-Time}!unlock@{unlock}}
\index{unlock@{unlock}!ost::SysTime@{ost::Sys\-Time}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static void ost::Sys\-Time::unlock (void)\hspace{0.3cm}{\tt  [inline, static, protected]}}\label{classost_1_1_sys_time_0d75e27d952de65d6e46b38e57ba605d}




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