Public Member Functions | Public Attributes | List of all members
SystemClockMock Class Reference

#include <clock.hpp>

Inheritance diagram for SystemClockMock:
Inheritance graph
[legend]

Public Member Functions

virtual void adjustUtc (uavcan::UtcDuration adjustment)
 
void advance (uint64_t usec) const
 
virtual uavcan::MonotonicTime getMonotonic () const
 
virtual uavcan::UtcTime getUtc () const
 
 SystemClockMock (uint64_t initial=0)
 
- Public Member Functions inherited from uavcan::ISystemClock
virtual ~ISystemClock ()
 

Public Attributes

uavcan::UtcDuration last_adjustment
 
uint64_t monotonic
 
uint64_t monotonic_auto_advance
 
bool preserve_utc
 
uint64_t utc
 

Detailed Description

Definition at line 12 of file libuavcan/libuavcan/test/clock.hpp.

Constructor & Destructor Documentation

◆ SystemClockMock()

SystemClockMock::SystemClockMock ( uint64_t  initial = 0)
inline

Definition at line 21 of file libuavcan/libuavcan/test/clock.hpp.

Member Function Documentation

◆ adjustUtc()

virtual void SystemClockMock::adjustUtc ( uavcan::UtcDuration  adjustment)
inlinevirtual

Adjust the network-synchronized clock. Refer to getUtc() for details.

For POSIX refer to adjtime(), settimeofday().

Parameters
[in]adjustmentAmount of time to add to the clock value.

Implements uavcan::ISystemClock.

Definition at line 51 of file libuavcan/libuavcan/test/clock.hpp.

◆ advance()

void SystemClockMock::advance ( uint64_t  usec) const
inline

Definition at line 28 of file libuavcan/libuavcan/test/clock.hpp.

◆ getMonotonic()

virtual uavcan::MonotonicTime SystemClockMock::getMonotonic ( ) const
inlinevirtual

Monototic system clock.

This clock shall never jump or change rate; the base time is irrelevant. This clock is mandatory and must remain functional at all times.

On POSIX systems use clock_gettime() with CLOCK_MONOTONIC.

Implements uavcan::ISystemClock.

Definition at line 37 of file libuavcan/libuavcan/test/clock.hpp.

◆ getUtc()

virtual uavcan::UtcTime SystemClockMock::getUtc ( ) const
inlinevirtual

Global network clock. It doesn't have to be UTC, the name is a bit misleading - actual time base doesn't matter.

This clock can be synchronized with other nodes on the bus, hence it can jump and/or change rate occasionally. This clock is optional; if it is not supported, return zero. Also return zero if the UTC time is not available yet (e.g. the device has just started up with no battery clock).

For POSIX refer to clock_gettime(), gettimeofday().

Implements uavcan::ISystemClock.

Definition at line 45 of file libuavcan/libuavcan/test/clock.hpp.

Member Data Documentation

◆ last_adjustment

uavcan::UtcDuration SystemClockMock::last_adjustment

Definition at line 17 of file libuavcan/libuavcan/test/clock.hpp.

◆ monotonic

uint64_t SystemClockMock::monotonic
mutable

Definition at line 15 of file libuavcan/libuavcan/test/clock.hpp.

◆ monotonic_auto_advance

uint64_t SystemClockMock::monotonic_auto_advance

Definition at line 18 of file libuavcan/libuavcan/test/clock.hpp.

◆ preserve_utc

bool SystemClockMock::preserve_utc

Definition at line 19 of file libuavcan/libuavcan/test/clock.hpp.

◆ utc

uint64_t SystemClockMock::utc
mutable

Definition at line 16 of file libuavcan/libuavcan/test/clock.hpp.


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


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04