class FakeClock

Defined at line 2804 of file fidling/gen/src/lib/fake-clock/fidl/fidl/hlcpp/fuchsia/testing/cpp/fidl.h

Allows access to fake clocks managed by `FakeClockControl`.

Public Members

static const char[] Name_

Public Methods

void ~FakeClock ()
void Get (GetCallback callback)

Gets the current time.

void RegisterEventInMonotonic (::zx::eventpair event, ::fidl::basic_time<((zx_clock_t)0)> time)

Registers the event handle `event` to be signaled with `ZX_EVENTPAIR_SIGNALED` when the

provided `time` is reached by the fake monotonic clock.

The `FakeClock` instance will retain this event (even after it's fired) for as long as the

client-side of the provided event pair `event` is open.

void RegisterEventInBoot (::zx::eventpair event, ::fidl::basic_time<((zx_clock_t)1)> time)

Registers the event handle `event` to be signaled with `ZX_EVENTPAIR_SIGNALED` when the

provided `time` is reached by the fake boot clock.

The `FakeClock` instance will retain this event (even after it's fired) for as long as the

client-side of the provided event pair `event` is open.

void RescheduleEventInMonotonic (::zx::eventpair event, ::fidl::basic_time<((zx_clock_t)0)> time, RescheduleEventInMonotonicCallback callback)

Reschedules an event to be signalled with `ZX_EVENTPAIR_SIGNALED` at the new deadline in

`time` on the monotonic clock.

`event` is a duplicate of the client-side of the event pair, and it's used to retrieve the

originally registered event through its kernel object identifier.

void RescheduleEventInBoot (::zx::eventpair event, ::fidl::basic_time<((zx_clock_t)1)> time, RescheduleEventInBootCallback callback)

Reschedules an event to be signalled with `ZX_EVENTPAIR_SIGNALED` at the new deadline in

`time` on the boot clock.

`event` is a duplicate of the client-side of the event pair, and it's used to retrieve the

originally registered event through its kernel object identifier.

void CancelEvent (::zx::eventpair event, CancelEventCallback callback)

Cancels a previously registered event.

`event` is a duplicate of the client-side of the event pair, and it's used to retrieve the

originally registered event through its kernel object identifier.

void CreateNamedDeadlineInMonotonic (::fuchsia::testing::deadline::DeadlineId id, int64_t duration, CreateNamedDeadlineInMonotonicCallback callback)

Calculate and set a deadline associated with an id on the monotonic clock.

The returned `deadline` is calculated as `duration` after the current fake time.

FakeClock emits two events: A `SET` event immediately, and an `EXPIRED` event when the

deadline expires. A test using `FakeClockControl` may reference events related to the

deadline using a matching `id`. See `FakeClockControl.SetStopPoint` for information on how a

test can wait for a deadline event.

void CreateNamedDeadlineInBoot (::fuchsia::testing::deadline::DeadlineId id, int64_t duration, CreateNamedDeadlineInBootCallback callback)

Calculate and set a deadline associated with an id on the boot clock.

The returned `deadline` is calculated as `duration` after the current fake time.

FakeClock emits two events: A `SET` event immediately, and an `EXPIRED` event when the

deadline expires. A test using `FakeClockControl` may reference events related to the

deadline using a matching `id`. See `FakeClockControl.SetStopPoint` for information on how a

test can wait for a deadline event.