ost::SysTime(3)
β¨ ost::SysTime β¨ β the Library Functions Manual glow-up π
okay bestie, so this is the tea on ost::SysTime from the GNU CommonC++ Library Functions Manual, and no cap, she is that girl. let's get into it π«Ά
πΈ NAME πΈ
ost::SysTime β this class is used to access non-reentrant date and time functions in the standard C library. yes. that's the whole vibe. π
π SYNOPSIS π
#include <thread.h>
β Static Public Member Functions β
static time_t getTime (time_t *tloc=NULL)
static time_t time (time_t *tloc)
static int getTimeOfDay (struct timeval *tp)
static int gettimeofday (struct timeval *tp, struct timezone *)
static struct tm * getLocalTime (const time_t *clock, struct tm *result)
static struct tm * locatime (const time_t *clock, struct tm *result)
static struct tm * getGMTTime (const time_t *clock, struct tm *result)
static struct tm * gmtime (const time_t *clock, struct tm *result)
π Static Protected Member Functions π
static void lock (void)
static void unlock (void)
π¦ Detailed Description π¦
This class is used to access non-reentrant date and time functions in the standard C library. it's giving "let me handle the scary thread-unsafe stuff for you" energy and honestly? we love her for it. π
The class has two purposes:
- 1 To be used internaly in CommonCpp's date and time classes to make them thread safe. (that spelling is verbatim from the original, bestie, don't come for me π)
- 2 To be used by clients as thread safe replacements to the standard C functions, much like
Thread::sleep()represents a thread safe version of the standardsleep()function.
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 tosedreplace 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*_rfunctions (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*_rfunctions as they aren't all generally available on all platforms yet.
π Author
Idar Tollefsen idar@cognita.no
Thread safe date and time functions.
π Member Function Documentation π
okay now the main character section, let's go one by one π
static struct tm* ost::SysTime::getGMTTime (const time_t * clock, struct tm * result) [static]
Referenced by ost::gmtime_r().
static struct tm* ost::SysTime::getLocalTime (const time_t * clock, struct tm * result) [static]
Referenced by ost::localtime_r().
static time_t ost::SysTime::getTime (time_t * tloc = NULL) [static]
(that default value is doing a little slay, ngl π)
static int ost::SysTime::getTimeOfDay (struct timeval * tp) [static]
static int ost::SysTime::gettimeofday (struct timeval * tp, struct timezone *) [inline], [static]
static struct tm* ost::SysTime::gmtime (const time_t * clock, struct tm * result) [inline], [static]
static struct tm* ost::SysTime::locatime (const time_t * clock, struct tm * result) [inline], [static]
static void ost::SysTime::lock (void) [inline], [static], [protected]
References ost::Mutex::enterMutex().
static time_t ost::SysTime::time (time_t * tloc) [inline], [static]
static void ost::SysTime::unlock (void) [inline], [static], [protected]
References ost::Mutex::leaveMutex().
π Author π
Generated automatically by Doxygen for GNU CommonC++ from the source code.
and that's the whole page, bestie, we ate and left no crumbs π₯
GNU CommonC++ β Sun Dec 27 2020 π that's the source, the version and the date, all wrapped up in a little bow π periodt. π β¨π¦
π¦ 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