Toolbox snapshot
The Reactive C++ Toolbox
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions
toolbox::sys Namespace Reference

Namespaces

namespace  detail
 

Classes

class  AsyncLogger
 
class  CyclTime
 
struct  IsoDatePolicy
 
struct  JDayPolicy
 
class  Log
 
class  Logger
 
struct  MonoClock
 
struct  PutTime
 
class  Runner
 
class  ScopedLogger
 
class  ScopedLogLevel
 
class  SigWait
 
struct  ThreadConfig
 ThreadConfig holds the thread attributes. More...
 
struct  WallClock
 

Typedefs

using IsoDate = IntWrapper< IsoDatePolicy >
 ISO8601 date in yyymmdd format.
 
using JDay = IntWrapper< JDayPolicy >
 Julian day.
 
using LogStream = util::OStream< MaxLogLine >
 Logger callback function.
 
using LogMsgPtr = StoragePtr< MaxLogLine >
 
using PidFile = std::unique_ptr< pidfh, detail::PidFileDeleter >
 
using Seconds = std::chrono::seconds
 
using Decis = std::chrono::duration< int64_t, std::deci >
 
using Millis = std::chrono::milliseconds
 
using Micros = std::chrono::microseconds
 
using Nanos = std::chrono::nanoseconds
 
using NanoTime = Nanos
 
using Duration = Nanos
 
using MonoTime = MonoClock::time_point
 
using WallTime = WallClock::time_point
 

Enumerations

enum  : std::size_t {
  CacheLineBits = 6 , CacheLineSize = 1 << CacheLineBits , PageBits = 12 , PageSize = 1 << PageBits ,
  MaxLogLine = 4096
}
 
enum class  LogLevel : int {
  None , Crit , Error , Warn ,
  Metric , Notice , Info , Debug
}
 

Functions

void close_all () noexcept
 Close all non-standard file handles.
 
void daemon ()
 Daemonise process. Detach from controlling terminal and run in the background as a system daemon.
 
constexpr auto operator""_ymd (unsigned long long val) noexcept
 
constexpr auto operator""_jd (unsigned long long val) noexcept
 
constexpr auto ymd_to_iso (int year, int mon, int mday) noexcept
 Gregorian to ISO8601 date.
 
constexpr auto ymd_to_jd (int year, int mon, int mday) noexcept
 Gregorian date to Julian day.
 
constexpr auto iso_to_jd (IsoDate iso) noexcept
 ISO8601 to Julian day.
 
constexpr auto jd_to_iso (JDay jd) noexcept
 Julian day to ISO8601.
 
constexpr std::int32_t jd_to_mjd (JDay jd) noexcept
 Juilian day to Modified Julian day. Epoch is November 17, 1858.
 
constexpr auto mjd_to_jd (std::int32_t mjd) noexcept
 Modified Julian day to Julian day. Epoch is November 17, 1858.
 
constexpr std::int32_t jd_to_tjd (JDay jd) noexcept
 Julian day to Truncated Julian day. Epoch is May 24, 1968.
 
constexpr JDay tjd_to_jd (std::int32_t tjd) noexcept
 Truncated Julian day to Julian day. Epoch is May 24, 1968.
 
constexpr WallTime jd_to_time (JDay jd) noexcept
 Julian day to Unix time.
 
constexpr IsoDate maybe_jd_to_iso (JDay jd) noexcept
 Julian day to ISO8601 if argument is non-zero.
 
constexpr JDay maybe_iso_to_jd (IsoDate iso) noexcept
 ISO8601 to Julian day if argument is non-zero.
 
constexpr bool is_week_day (JDay jday) noexcept
 
constexpr bool is_weekend_day (JDay jday) noexcept
 
constexpr auto parse_date (std::string_view sv) noexcept
 
constexpr std::optional< WallTimeparse_time (std::string_view sv) noexcept
 
std::error_code make_error (int err) noexcept
 
constexpr std::size_t ceil_cache_line (std::size_t size) noexcept
 
constexpr std::size_t ceil_page (std::size_t size) noexcept
 
LogStreamlog_stream () noexcept
 
Loggernull_logger () noexcept
 Null logger. This logger does nothing and is effectively /dev/null.
 
Loggerstd_logger () noexcept
 
Loggersys_logger () noexcept
 System logger. This logger calls syslog().
 
const charlog_label (LogLevel level) noexcept
 Return log label for given log level.
 
LogLevel get_log_level () noexcept
 Return current log level.
 
LogLevel set_log_level (LogLevel level) noexcept
 Set log level globally for all threads.
 
Loggerget_logger () noexcept
 Return current logger.
 
Loggerset_logger (Logger &logger) noexcept
 Set logger globally for all threads.
 
void write_log (WallTime ts, LogLevel level, LogMsgPtr &&msg, std::size_t size) noexcept
 
bool is_log_level (LogLevel level) noexcept
 Return true if level is less than or equal to current log level.
 
Loggerset_logger (std::nullptr_t) noexcept
 
std::ostream & operator<< (std::ostream &os, LogLevel level)
 
PidFile open_pid_file (const char *path, mode_t mode)
 
void close_pid_file (PidFile &pf) noexcept
 Close pidfile without removing it. This function should be used when forking daemon processes.
 
void write_pid_file (PidFile &pf)
 Write process' PID into pidfile.
 
void sig_block_all ()
 Block all signals.
 
cpu_set_t parse_cpu_set (string_view s) noexcept
 
int parse_sched_policy (string_view s)
 
void set_thread_attrs (const ThreadConfig &config)
 
TOOLBOX_WEAK Nanos get_time (clockid_t clock_id) noexcept
 
ostream & operator<< (ostream &os, MonoTime t)
 
ostream & operator<< (ostream &os, WallTime t)
 
template<typename RepT , typename PeriodT >
constexpr bool is_zero (std::chrono::duration< RepT, PeriodT > d) noexcept
 
template<typename ClockT >
constexpr bool is_zero (std::chrono::time_point< ClockT, Duration > t) noexcept
 
template<typename ClockT , typename DurationT >
constexpr DurationT time_since_epoch (std::chrono::time_point< ClockT, Duration > t) noexcept
 
template<typename ClockT >
constexpr std::int64_t ms_since_epoch (std::chrono::time_point< ClockT, Duration > t) noexcept
 
template<typename ClockT >
constexpr std::int64_t us_since_epoch (std::chrono::time_point< ClockT, Duration > t) noexcept
 
template<typename ClockT >
constexpr std::int64_t ns_since_epoch (std::chrono::time_point< ClockT, Duration > t) noexcept
 
template<typename ClockT , typename RepT , typename PeriodT >
constexpr auto to_time (std::chrono::duration< RepT, PeriodT > d) noexcept
 
template<typename ClockT >
constexpr auto to_time (timeval tv) noexcept
 
template<typename ClockT >
constexpr auto to_time (timespec ts) noexcept
 
template<typename RepT , typename PeriodT >
constexpr timeval to_timeval (std::chrono::duration< RepT, PeriodT > d) noexcept
 
template<typename ClockT >
constexpr timeval to_timeval (std::chrono::time_point< ClockT, Duration > t) noexcept
 
template<typename RepT , typename PeriodT >
constexpr timespec to_timespec (std::chrono::duration< RepT, PeriodT > d) noexcept
 
template<typename ClockT >
constexpr timespec to_timespec (std::chrono::time_point< ClockT, Duration > t) noexcept
 
template<typename DurationT = Seconds>
auto put_time (WallTime t, const char *fmt) noexcept
 
template<typename DurationT >
std::ostream & operator<< (std::ostream &os, PutTime< DurationT > pt)
 
constexpr bool is_zero (timeval tv) noexcept
 
void clear (timeval &tv) noexcept
 
timeval operator+ (timeval lhs, timeval rhs) noexcept
 
timeval operator- (timeval lhs, timeval rhs) noexcept
 
constexpr bool is_zero (timespec ts) noexcept
 
void clear (timespec &ts) noexcept
 
timespec operator+ (timespec lhs, timespec rhs) noexcept
 
timespec operator- (timespec lhs, timespec rhs) noexcept
 
constexpr auto parse_nanos (std::string_view sv) noexcept
 
constexpr std::optional< Nanosparse_time_only (std::string_view sv) noexcept
 

Typedef Documentation

◆ IsoDate

ISO8601 date in yyymmdd format.

Definition at line 30 of file Date.hpp.

◆ JDay

Julian day.

Definition at line 38 of file Date.hpp.

◆ LogStream

Logger callback function.

Definition at line 28 of file Log.hpp.

◆ LogMsgPtr

Definition at line 51 of file Logger.hpp.

◆ PidFile

Definition at line 34 of file PidFile.hpp.

◆ Seconds

using toolbox::sys::Seconds = typedef std::chrono::seconds

Definition at line 33 of file Time.hpp.

◆ Decis

using toolbox::sys::Decis = typedef std::chrono::duration<int64_t, std::deci>

Definition at line 34 of file Time.hpp.

◆ Millis

using toolbox::sys::Millis = typedef std::chrono::milliseconds

Definition at line 35 of file Time.hpp.

◆ Micros

using toolbox::sys::Micros = typedef std::chrono::microseconds

Definition at line 36 of file Time.hpp.

◆ Nanos

using toolbox::sys::Nanos = typedef std::chrono::nanoseconds

Definition at line 37 of file Time.hpp.

◆ NanoTime

Definition at line 39 of file Time.hpp.

◆ Duration

Definition at line 40 of file Time.hpp.

◆ MonoTime

Definition at line 110 of file Time.hpp.

◆ WallTime

Definition at line 111 of file Time.hpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : std::size_t
Enumerator
CacheLineBits 
CacheLineSize 
PageBits 
PageSize 
MaxLogLine 

Maximum log line size.

Definition at line 29 of file Limits.hpp.

◆ LogLevel

Enumerator
None 

None.

Crit 

Critical.

Error 

Error.

Warn 

Warning.

Metric 
Notice 

Notice.

Info 

Information.

Debug 

Debug.

Definition at line 32 of file Logger.hpp.

Function Documentation

◆ close_all()

TOOLBOX_API void toolbox::sys::close_all ( )
noexcept

Close all non-standard file handles.

Definition at line 27 of file Daemon.cpp.

◆ daemon()

TOOLBOX_API void toolbox::sys::daemon ( )

Daemonise process. Detach from controlling terminal and run in the background as a system daemon.

Definition at line 36 of file Daemon.cpp.

◆ operator""_ymd()

constexpr auto toolbox::sys::operator""_ymd ( unsigned long long  val)
constexprnoexcept

Definition at line 32 of file Date.hpp.

◆ operator""_jd()

constexpr auto toolbox::sys::operator""_jd ( unsigned long long  val)
constexprnoexcept

Definition at line 40 of file Date.hpp.

◆ ymd_to_iso()

constexpr auto toolbox::sys::ymd_to_iso ( int  year,
int  mon,
int  mday 
)
constexprnoexcept

Gregorian to ISO8601 date.

Definition at line 46 of file Date.hpp.

◆ ymd_to_jd()

constexpr auto toolbox::sys::ymd_to_jd ( int  year,
int  mon,
int  mday 
)
constexprnoexcept

Gregorian date to Julian day.

Definition at line 54 of file Date.hpp.

◆ iso_to_jd()

constexpr auto toolbox::sys::iso_to_jd ( IsoDate  iso)
constexprnoexcept

ISO8601 to Julian day.

Definition at line 69 of file Date.hpp.

◆ jd_to_iso()

constexpr auto toolbox::sys::jd_to_iso ( JDay  jd)
constexprnoexcept

Julian day to ISO8601.

Definition at line 79 of file Date.hpp.

◆ jd_to_mjd()

constexpr std::int32_t toolbox::sys::jd_to_mjd ( JDay  jd)
constexprnoexcept

Juilian day to Modified Julian day. Epoch is November 17, 1858.

Definition at line 100 of file Date.hpp.

◆ mjd_to_jd()

constexpr auto toolbox::sys::mjd_to_jd ( std::int32_t  mjd)
constexprnoexcept

Modified Julian day to Julian day. Epoch is November 17, 1858.

Definition at line 106 of file Date.hpp.

◆ jd_to_tjd()

constexpr std::int32_t toolbox::sys::jd_to_tjd ( JDay  jd)
constexprnoexcept

Julian day to Truncated Julian day. Epoch is May 24, 1968.

Definition at line 112 of file Date.hpp.

◆ tjd_to_jd()

constexpr JDay toolbox::sys::tjd_to_jd ( std::int32_t  tjd)
constexprnoexcept

Truncated Julian day to Julian day. Epoch is May 24, 1968.

Definition at line 118 of file Date.hpp.

◆ jd_to_time()

constexpr WallTime toolbox::sys::jd_to_time ( JDay  jd)
constexprnoexcept

Julian day to Unix time.

Definition at line 124 of file Date.hpp.

◆ maybe_jd_to_iso()

constexpr IsoDate toolbox::sys::maybe_jd_to_iso ( JDay  jd)
constexprnoexcept

Julian day to ISO8601 if argument is non-zero.

Definition at line 134 of file Date.hpp.

◆ maybe_iso_to_jd()

constexpr JDay toolbox::sys::maybe_iso_to_jd ( IsoDate  iso)
constexprnoexcept

ISO8601 to Julian day if argument is non-zero.

Definition at line 140 of file Date.hpp.

◆ is_week_day()

constexpr bool toolbox::sys::is_week_day ( JDay  jday)
constexprnoexcept

Definition at line 145 of file Date.hpp.

◆ is_weekend_day()

constexpr bool toolbox::sys::is_weekend_day ( JDay  jday)
constexprnoexcept

Definition at line 150 of file Date.hpp.

◆ parse_date()

constexpr auto toolbox::sys::parse_date ( std::string_view  sv)
constexprnoexcept

Date represented in UTC (Universal Time Coordinated, also known as "GMT") in YYYYMMDD format. This special-purpose field is paired with UTCTimeOnly to form a proper UTCTimestamp for bandwidth-sensitive messages.

Valid values:

  • YYYY = 0000-9999;
  • MM = 01-12;
  • DD = 01-31.

Definition at line 163 of file Date.hpp.

◆ parse_time()

constexpr std::optional< WallTime > toolbox::sys::parse_time ( std::string_view  sv)
constexprnoexcept

Time/date combination represented in UTC (Universal Time Coordinated, also known as "GMT") in either YYYYMMDD-HH:MM:SS (whole seconds) or YYYYMMDD-HH:MM:SS.sss (milliseconds) format, colons, dash, and period required.

Valid values:

  • YYYY = 0000-9999;
  • MM = 01-12;
  • DD = 01-31;
  • HH = 00-23;
  • MM = 00-59;
  • SS = 00-60 (60 only if UTC leap second);
  • sss = 000-999 (indicating milliseconds).

Definition at line 181 of file Date.hpp.

◆ make_error()

std::error_code toolbox::sys::make_error ( int  err)
inlinenoexcept

◆ ceil_cache_line()

constexpr std::size_t toolbox::sys::ceil_cache_line ( std::size_t  size)
constexprnoexcept

Definition at line 38 of file Limits.hpp.

◆ ceil_page()

constexpr std::size_t toolbox::sys::ceil_page ( std::size_t  size)
constexprnoexcept

Definition at line 43 of file Limits.hpp.

◆ log_stream()

TOOLBOX_API LogStream & toolbox::sys::log_stream ( )
noexcept

Thread-local log stream. This thread-local instance of OStream can be used to format log messages before writing them the log.

Definition at line 26 of file Log.cpp.

◆ null_logger()

TOOLBOX_API Logger & toolbox::sys::null_logger ( )
noexcept

Null logger. This logger does nothing and is effectively /dev/null.

Definition at line 140 of file Logger.cpp.

◆ std_logger()

TOOLBOX_API Logger & toolbox::sys::std_logger ( )
noexcept

Standard logger. This logger writes to stdout if the log level is greater than LogWarn, and stdout otherwise.

Definition at line 145 of file Logger.cpp.

◆ sys_logger()

TOOLBOX_API Logger & toolbox::sys::sys_logger ( )
noexcept

System logger. This logger calls syslog().

Definition at line 150 of file Logger.cpp.

◆ log_label()

TOOLBOX_API const char * toolbox::sys::log_label ( LogLevel  level)
noexcept

Return log label for given log level.

Definition at line 155 of file Logger.cpp.

◆ get_log_level()

TOOLBOX_API LogLevel toolbox::sys::get_log_level ( )
noexcept

Return current log level.

Definition at line 160 of file Logger.cpp.

◆ set_log_level()

TOOLBOX_API LogLevel toolbox::sys::set_log_level ( LogLevel  level)
noexcept

Set log level globally for all threads.

Definition at line 165 of file Logger.cpp.

◆ get_logger()

TOOLBOX_API Logger & toolbox::sys::get_logger ( )
noexcept

Return current logger.

Definition at line 170 of file Logger.cpp.

◆ set_logger() [1/2]

TOOLBOX_API Logger & toolbox::sys::set_logger ( Logger logger)
noexcept

Set logger globally for all threads.

Definition at line 175 of file Logger.cpp.

◆ write_log()

TOOLBOX_API void toolbox::sys::write_log ( WallTime  ts,
LogLevel  level,
LogMsgPtr &&  msg,
std::size_t  size 
)
noexcept

Unconditionally write log message to the logger. Specifically, this function does not check that level is allowed by the current log level; users are expected to call is_log_level() first, before formatting the log message.

Definition at line 180 of file Logger.cpp.

Referenced by toolbox::sys::Log::~Log().

◆ is_log_level()

bool toolbox::sys::is_log_level ( LogLevel  level)
inlinenoexcept

Return true if level is less than or equal to current log level.

Definition at line 70 of file Logger.hpp.

◆ set_logger() [2/2]

Logger & toolbox::sys::set_logger ( std::nullptr_t  )
inlinenoexcept

Definition at line 84 of file Logger.hpp.

◆ operator<<() [1/4]

std::ostream & toolbox::sys::operator<< ( std::ostream &  os,
LogLevel  level 
)
inline

Definition at line 202 of file Logger.hpp.

◆ open_pid_file()

TOOLBOX_API PidFile toolbox::sys::open_pid_file ( const char path,
mode_t  mode 
)

Create pidfile and obtain lock. An exception is thrown if the pidfile cannot be locked, because a daemon is already running. If the path argument is null, then /var/run/{progname}.pid is used as the pidfile location.

Definition at line 38 of file PidFile.cpp.

◆ close_pid_file()

TOOLBOX_API void toolbox::sys::close_pid_file ( PidFile pf)
noexcept

Close pidfile without removing it. This function should be used when forking daemon processes.

Definition at line 51 of file PidFile.cpp.

◆ write_pid_file()

TOOLBOX_API void toolbox::sys::write_pid_file ( PidFile pf)

Write process' PID into pidfile.

Definition at line 58 of file PidFile.cpp.

◆ sig_block_all()

TOOLBOX_API void toolbox::sys::sig_block_all ( )

Block all signals.

Definition at line 82 of file Signal.cpp.

Referenced by toolbox::sys::Runner< RunnableT >::operator=().

◆ parse_cpu_set()

TOOLBOX_API cpu_set_t toolbox::sys::parse_cpu_set ( std::string_view  s)
noexcept

Parse an isolcpus-style set of CPUs.

The CPU set is either a list: "<cpu>,...,<cpu>", or a range: "<cpu>-<cpu>", or a combination or both: "<cpu>,...,<cpu>-<cpu>", where "<cpu>" begins at 0 and the maximum value is "number of CPUs in system - 1". For example: "0,1,10-11,22-23".

Parameters
sAn isolcpus-style set of CPUs.
Returns
a copy of the CPU set.

Definition at line 35 of file Thread.cpp.

◆ parse_sched_policy()

TOOLBOX_API int toolbox::sys::parse_sched_policy ( std::string_view  s)

Parse scheduler policy name, where

Parameters
sis one of: other, fifo, rr, batch or idle.

Realtime scheduling policies are: fifo and rr.

Parameters
sThe policy name.
Returns
the policy.

Definition at line 51 of file Thread.cpp.

◆ set_thread_attrs()

TOOLBOX_API void toolbox::sys::set_thread_attrs ( const ThreadConfig config)

Set attributes for current thread from config.

Parameters
configThe configuration.

Definition at line 70 of file Thread.cpp.

Referenced by toolbox::sys::Runner< RunnableT >::operator=().

◆ get_time()

TOOLBOX_API NanoTime toolbox::sys::get_time ( clockid_t  clock_id)
noexcept

Definition at line 25 of file Time.cpp.

Referenced by toolbox::sys::MonoClock::now(), and toolbox::sys::WallClock::now().

◆ operator<<() [2/4]

TOOLBOX_API std::ostream & toolbox::sys::operator<< ( ostream &  os,
MonoTime  t 
)

Definition at line 33 of file Time.cpp.

◆ operator<<() [3/4]

TOOLBOX_API std::ostream & toolbox::sys::operator<< ( ostream &  os,
WallTime  t 
)

Definition at line 38 of file Time.cpp.

◆ is_zero() [1/4]

template<typename RepT , typename PeriodT >
constexpr bool toolbox::sys::is_zero ( std::chrono::duration< RepT, PeriodT d)
constexprnoexcept

Definition at line 156 of file Time.hpp.

◆ is_zero() [2/4]

template<typename ClockT >
constexpr bool toolbox::sys::is_zero ( std::chrono::time_point< ClockT, Duration t)
constexprnoexcept

Definition at line 162 of file Time.hpp.

◆ time_since_epoch()

constexpr DurationT toolbox::sys::time_since_epoch ( std::chrono::time_point< ClockT, Duration t)
constexprnoexcept

Definition at line 168 of file Time.hpp.

◆ ms_since_epoch()

template<typename ClockT >
constexpr std::int64_t toolbox::sys::ms_since_epoch ( std::chrono::time_point< ClockT, Duration t)
constexprnoexcept

Definition at line 176 of file Time.hpp.

◆ us_since_epoch()

template<typename ClockT >
constexpr std::int64_t toolbox::sys::us_since_epoch ( std::chrono::time_point< ClockT, Duration t)
constexprnoexcept

Definition at line 183 of file Time.hpp.

◆ ns_since_epoch()

template<typename ClockT >
constexpr std::int64_t toolbox::sys::ns_since_epoch ( std::chrono::time_point< ClockT, Duration t)
constexprnoexcept

Definition at line 190 of file Time.hpp.

◆ to_time() [1/3]

constexpr auto toolbox::sys::to_time ( std::chrono::duration< RepT, PeriodT d)
constexprnoexcept

Definition at line 198 of file Time.hpp.

◆ to_time() [2/3]

template<typename ClockT >
constexpr auto toolbox::sys::to_time ( timeval  tv)
constexprnoexcept

Definition at line 205 of file Time.hpp.

◆ to_time() [3/3]

template<typename ClockT >
constexpr auto toolbox::sys::to_time ( timespec  ts)
constexprnoexcept

Definition at line 212 of file Time.hpp.

◆ to_timeval() [1/2]

template<typename RepT , typename PeriodT >
constexpr timeval toolbox::sys::to_timeval ( std::chrono::duration< RepT, PeriodT d)
constexprnoexcept

Definition at line 219 of file Time.hpp.

◆ to_timeval() [2/2]

template<typename ClockT >
constexpr timeval toolbox::sys::to_timeval ( std::chrono::time_point< ClockT, Duration t)
constexprnoexcept

Definition at line 227 of file Time.hpp.

◆ to_timespec() [1/2]

template<typename RepT , typename PeriodT >
constexpr timespec toolbox::sys::to_timespec ( std::chrono::duration< RepT, PeriodT d)
constexprnoexcept

Definition at line 234 of file Time.hpp.

Referenced by toolbox::sys::SigWait::operator()().

◆ to_timespec() [2/2]

template<typename ClockT >
constexpr timespec toolbox::sys::to_timespec ( std::chrono::time_point< ClockT, Duration t)
constexprnoexcept

Definition at line 242 of file Time.hpp.

◆ put_time()

template<typename DurationT = Seconds>
auto toolbox::sys::put_time ( WallTime  t,
const char fmt 
)
noexcept

Definition at line 255 of file Time.hpp.

◆ operator<<() [4/4]

template<typename DurationT >
std::ostream & toolbox::sys::operator<< ( std::ostream &  os,
PutTime< DurationT pt 
)

Definition at line 261 of file Time.hpp.

◆ is_zero() [3/4]

constexpr bool toolbox::sys::is_zero ( timeval  tv)
constexprnoexcept

Definition at line 289 of file Time.hpp.

◆ clear() [1/2]

void toolbox::sys::clear ( timeval tv)
inlinenoexcept

Definition at line 294 of file Time.hpp.

◆ operator+() [1/2]

timeval toolbox::sys::operator+ ( timeval  lhs,
timeval  rhs 
)
inlinenoexcept

Definition at line 299 of file Time.hpp.

◆ operator-() [1/2]

timeval toolbox::sys::operator- ( timeval  lhs,
timeval  rhs 
)
inlinenoexcept

Definition at line 311 of file Time.hpp.

◆ is_zero() [4/4]

constexpr bool toolbox::sys::is_zero ( timespec  ts)
constexprnoexcept

Definition at line 323 of file Time.hpp.

◆ clear() [2/2]

void toolbox::sys::clear ( timespec ts)
inlinenoexcept

Definition at line 328 of file Time.hpp.

◆ operator+() [2/2]

timespec toolbox::sys::operator+ ( timespec  lhs,
timespec  rhs 
)
inlinenoexcept

Definition at line 333 of file Time.hpp.

◆ operator-() [2/2]

timespec toolbox::sys::operator- ( timespec  lhs,
timespec  rhs 
)
inlinenoexcept

Definition at line 345 of file Time.hpp.

◆ parse_nanos()

constexpr auto toolbox::sys::parse_nanos ( std::string_view  sv)
constexprnoexcept

Parse fractional nanoseconds.

Parameters
svString of decimal digits.
Returns
nanoseconds.

Definition at line 360 of file Time.hpp.

◆ parse_time_only()

constexpr std::optional< Nanos > toolbox::sys::parse_time_only ( std::string_view  sv)
constexprnoexcept

Time-only represented in UTC (Universal Time Coordinated, also known as "GMT") in either HH:MM:SS (whole seconds) or HH:MM:SS.sss (milliseconds) format, colons, and period required. This special-purpose field is paired with UTCDateOnly to form a proper UTCTimestamp for bandwidth-sensitive messages. Valid values: HH = 00-23, MM = 00-59, SS = 00-5960 (60 only if UTC leap second) (without milliseconds). HH = 00-23, MM = 00-59, SS = 00-5960 (60 only if UTC leap second), sss=000-999 (indicating milliseconds).

Definition at line 399 of file Time.hpp.