WPILibC++ 2024.1.1-beta-4
wpi::sys Namespace Reference

Typedefs

template<typename D = std::chrono::nanoseconds>
using TimePoint = std::chrono::time_point< std::chrono::system_clock, D >
 A time point on the system clock. More...
 

Functions

template<typename FailT , typename Fun , typename... Args>
decltype(auto) RetryAfterSignal (const FailT &Fail, const Fun &F, const Args &... As)
 
std::time_t toTimeT (TimePoint<> TP)
 Convert a TimePoint to std::time_t. More...
 
TimePoint< std::chrono::seconds > toTimePoint (std::time_t T)
 Convert a std::time_t to a TimePoint. More...
 
TimePoint toTimePoint (std::time_t T, uint32_t nsec)
 Convert a std::time_t + nanoseconds to a TimePoint. More...
 
unsigned char getSwappedBytes (unsigned char C)
 
signed char getSwappedBytes (signed char C)
 
char getSwappedBytes (char C)
 
unsigned short getSwappedBytes (unsigned short C)
 
signed short getSwappedBytes (signed short C)
 
unsigned int getSwappedBytes (unsigned int C)
 
signed int getSwappedBytes (signed int C)
 
unsigned long getSwappedBytes (unsigned long C)
 
signed long getSwappedBytes (signed long C)
 
unsigned long long getSwappedBytes (unsigned long long C)
 
signed long long getSwappedBytes (signed long long C)
 
float getSwappedBytes (float C)
 
double getSwappedBytes (double C)
 
template<typename T >
std::enable_if_t< std::is_enum_v< T >, T > getSwappedBytes (T C)
 
template<typename T >
void swapByteOrder (T &Value)
 

Variables

constexpr bool IsBigEndianHost = false
 
static const bool IsLittleEndianHost = !IsBigEndianHost
 

Typedef Documentation

◆ TimePoint

template<typename D = std::chrono::nanoseconds>
using wpi::sys::TimePoint = typedef std::chrono::time_point<std::chrono::system_clock, D>

A time point on the system clock.

This is provided for two reasons:

  • to insulate us against subtle differences in behavior to differences in system clock precision (which is implementation-defined and differs between platforms).
  • to shorten the type name The default precision is nanoseconds. If you need a specific precision specify it explicitly. If unsure, use the default. If you need a time point on a clock other than the system_clock, use std::chrono directly.

Function Documentation

◆ getSwappedBytes() [1/14]

char wpi::sys::getSwappedBytes ( char  C)
inline

◆ getSwappedBytes() [2/14]

double wpi::sys::getSwappedBytes ( double  C)
inline

◆ getSwappedBytes() [3/14]

float wpi::sys::getSwappedBytes ( float  C)
inline

◆ getSwappedBytes() [4/14]

signed char wpi::sys::getSwappedBytes ( signed char  C)
inline

◆ getSwappedBytes() [5/14]

signed int wpi::sys::getSwappedBytes ( signed int  C)
inline

◆ getSwappedBytes() [6/14]

signed long wpi::sys::getSwappedBytes ( signed long  C)
inline

◆ getSwappedBytes() [7/14]

signed long long wpi::sys::getSwappedBytes ( signed long long  C)
inline

◆ getSwappedBytes() [8/14]

signed short wpi::sys::getSwappedBytes ( signed short  C)
inline

◆ getSwappedBytes() [9/14]

template<typename T >
std::enable_if_t< std::is_enum_v< T >, T > wpi::sys::getSwappedBytes ( C)
inline

◆ getSwappedBytes() [10/14]

unsigned char wpi::sys::getSwappedBytes ( unsigned char  C)
inline

◆ getSwappedBytes() [11/14]

unsigned int wpi::sys::getSwappedBytes ( unsigned int  C)
inline

◆ getSwappedBytes() [12/14]

unsigned long wpi::sys::getSwappedBytes ( unsigned long  C)
inline

◆ getSwappedBytes() [13/14]

unsigned long long wpi::sys::getSwappedBytes ( unsigned long long  C)
inline

◆ getSwappedBytes() [14/14]

unsigned short wpi::sys::getSwappedBytes ( unsigned short  C)
inline

◆ RetryAfterSignal()

template<typename FailT , typename Fun , typename... Args>
decltype(auto) wpi::sys::RetryAfterSignal ( const FailT &  Fail,
const Fun &  F,
const Args &...  As 
)
inline

◆ swapByteOrder()

template<typename T >
void wpi::sys::swapByteOrder ( T &  Value)
inline

◆ toTimePoint() [1/2]

TimePoint< std::chrono::seconds > wpi::sys::toTimePoint ( std::time_t  T)
inline

Convert a std::time_t to a TimePoint.

◆ toTimePoint() [2/2]

TimePoint wpi::sys::toTimePoint ( std::time_t  T,
uint32_t  nsec 
)
inline

Convert a std::time_t + nanoseconds to a TimePoint.

◆ toTimeT()

std::time_t wpi::sys::toTimeT ( TimePoint<>  TP)
inline

Convert a TimePoint to std::time_t.

Variable Documentation

◆ IsBigEndianHost

constexpr bool wpi::sys::IsBigEndianHost = false
constexpr

◆ IsLittleEndianHost

const bool wpi::sys::IsLittleEndianHost = !IsBigEndianHost
static