Loading...
Searching...
No Matches
gpiod::timestamp Class Referencefinal

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
| Real-time time_point.

## Public Member Functions

| timestamp (::std::uint64_t ns)
| Constructor with implicit conversion from uint64_t.
| timestamp (const timestamp &other) noexcept=default
| Copy constructor.
| timestamp (timestamp &&other) noexcept=default
| Move constructor.
timestamp & | operator= (const timestamp &other) noexcept=default
| Assignment operator.
timestamp & | operator= (timestamp &&other) noexcept=default
| Move assignment operator.
| ~timestamp ()=default
| operator::std::uint64_t () noexcept
| Conversion operator to std::uint64_t.
::std::uint64_t | ns () const noexcept
| Get the timestamp in nanoseconds.
time_point_monotonic | to_time_point_monotonic () const
| Convert the timestamp to a monotonic time_point.
time_point_realtime | to_time_point_realtime () const
| Convert the timestamp to a real-time time_point.

## Detailed Description

Stores the edge and info event timestamps as returned by the kernel and allows to convert them to std::chrono::time_point.

## Member Typedef Documentation

## time_point_monotonic

using gpiod::timestamp::time_point_monotonic = ::std::chrono::time_point<::std::chrono::steady_clock>

Monotonic time_point.

## time_point_realtime

using gpiod::timestamp::time_point_realtime

Initial value:
::std::chrono::time_point<::std::chrono::system_clock,
::std::chrono::nanoseconds>

Real-time time_point.

## Constructor & Destructor Documentation

## timestamp() [1/3]

gpiod::timestamp::timestamp | ( | ::std::uint64_t | ns | ) |

inline

Constructor with implicit conversion from uint64_t.

Parameters

  ns | Timestamp in nanoseconds.

## timestamp() [2/3]

gpiod::timestamp::timestamp | ( | const timestamp & | other | ) |

default noexcept

Copy constructor.

Parameters

  other | Object to copy.

## timestamp() [3/3]

gpiod::timestamp::timestamp | ( | timestamp && | other | ) |

default noexcept

Move constructor.

Parameters

  other | Object to move.

## ~timestamp()

gpiod::timestamp::~timestamp | ( |  | ) |

default

## Member Function Documentation

## ns()

::std::uint64_t gpiod::timestamp::ns | ( |  | ) | const

inline noexcept

Get the timestamp in nanoseconds.

Returns
  Timestamp in nanoseconds.

## operator::std::uint64_t()

gpiod::timestamp::operator::std::uint64_t | ( |  | ) |

inline noexcept

Conversion operator to std::uint64_t.

## operator=() [1/2]

timestamp & gpiod::timestamp::operator= | ( | const timestamp & | other | ) |

default noexcept

Assignment operator.

Parameters

  other | Object to copy.

Returns
  Reference to self.

## operator=() [2/2]

timestamp & gpiod::timestamp::operator= | ( | timestamp && | other | ) |

default noexcept

Move assignment operator.

Parameters

  other | Object to move.

Returns
  Reference to self.

## to_time_point_monotonic()

time_point_monotonic gpiod::timestamp::to_time_point_monotonic | ( |  | ) | const

inline

Convert the timestamp to a monotonic time_point.

Returns
  time_point associated with the steady clock.

## to_time_point_realtime()

time_point_realtime gpiod::timestamp::to_time_point_realtime | ( |  | ) | const

inline

Convert the timestamp to a real-time time_point.

Returns
  time_point associated with the system clock.

The documentation for this class was generated from the following file:

- timestamp.hpp