Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

ost::SysTime Class Reference

This class is used to access non-reentrant date and time functions in the standard C library. Thread safe date and time functions. More...

#include <thread.h>

List of all members.

Static Public Methods

time_t getTime (time_t *tloc=NULL)
time_t time (time_t *tloc)
int getTimeOfDay (struct timeval *tp)
int gettimeofday (struct timeval *tp, struct timezone *)
struct tm* getLocalTime (const time_t *clock, struct tm *result)
struct tm* locatime (const time_t *clock, struct tm *result)
struct tm* getGMTTime (const time_t *clock, struct tm *result)
struct tm* gmtime (const time_t *clock, struct tm *result)

Static Protected Methods

void lock (void)
void unlock (void)


Detailed Description

This class is used to access non-reentrant date and time functions in the standard C library. Thread safe date and time functions.

The class has two purposes:

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.

Note:
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 *_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 *_r functions as they aren't all generally available on all platforms yet.

Author:
Idar Tollefsen <idar@cognita.no>


Member Function Documentation

struct tm * ost::SysTime::getGMTTime ( const time_t * clock,
struct tm * result ) [static]
 

struct tm * ost::SysTime::getLocalTime ( const time_t * clock,
struct tm * result ) [static]
 

time_t ost::SysTime::getTime ( time_t * tloc = NULL ) [static]
 

int ost::SysTime::getTimeOfDay ( struct timeval * tp ) [static]
 

int ost::SysTime::gettimeofday ( struct timeval * tp,
struct timezone * ) [inline, static]
 

struct tm * ost::SysTime::gmtime ( const time_t * clock,
struct tm * result ) [inline, static]
 

struct tm * ost::SysTime::locatime ( const time_t * clock,
struct tm * result ) [inline, static]
 

void ost::SysTime::lock ( void ) [inline, static, protected]
 

time_t ost::SysTime::time ( time_t * tloc ) [inline, static]
 

void ost::SysTime::unlock ( void ) [inline, static, protected]
 


The documentation for this class was generated from the following file:
Generated at Fri May 30 14:51:04 2008 for GNU CommonC++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001