libgpiod
2.0.1
|
Stores the edge and info event timestamps as returned by the kernel and allows to convert them to std::chrono::time_point. More...
#include <timestamp.hpp>
Public Types | |
using | time_point_monotonic = ::std::chrono::time_point<::std::chrono::steady_clock > |
Monotonic time_point. | |
using | time_point_realtime = ::std::chrono::time_point<::std::chrono::system_clock, ::std::chrono::nanoseconds > |
Real-time time_point. | |
Public Member Functions | |
timestamp (::std::uint64_t ns) | |
Constructor with implicit conversion from uint64_t . More... | |
timestamp (const timestamp &other) noexcept=default | |
Copy constructor. More... | |
timestamp (timestamp &&other) noexcept=default | |
Move constructor. More... | |
timestamp & | operator= (const timestamp &other) noexcept=default |
Assignment operator. More... | |
timestamp & | operator= (timestamp &&other) noexcept=default |
Move assignment operator. More... | |
operator::std::uint64_t () noexcept | |
Conversion operator to std::uint64_t . | |
::std::uint64_t | ns () const noexcept |
Get the timestamp in nanoseconds. More... | |
time_point_monotonic | to_time_point_monotonic () const |
Convert the timestamp to a monotonic time_point. More... | |
time_point_realtime | to_time_point_realtime () const |
Convert the timestamp to a real-time time_point. More... | |
Stores the edge and info event timestamps as returned by the kernel and allows to convert them to std::chrono::time_point.
Definition at line 29 of file timestamp.hpp.
|
inline |
Constructor with implicit conversion from uint64_t
.
ns | Timestamp in nanoseconds. |
Definition at line 48 of file timestamp.hpp.
|
defaultnoexcept |
Copy constructor.
other | Object to copy. |
|
defaultnoexcept |
Move constructor.
other | Object to move. |
|
inlinenoexcept |
Get the timestamp in nanoseconds.
Definition at line 90 of file timestamp.hpp.
Referenced by operator::std::uint64_t(), to_time_point_monotonic(), and to_time_point_realtime().
Assignment operator.
other | Object to copy. |
Move assignment operator.
other | Object to move. |
|
inline |
Convert the timestamp to a monotonic time_point.
Definition at line 99 of file timestamp.hpp.
References ns().
|
inline |
Convert the timestamp to a real-time time_point.
Definition at line 108 of file timestamp.hpp.
References ns().