class FakeClockControl

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

Provides control over fake clocks.

`FakeClockControl` provides complete control of the fake clocks that it provides, and serves

over `FakeClock`.

Upon start up, all the clocks are set to free-running with increments set to 1ms:1ms (same as

calling `SetIncrements` with a `real` duration of 1ms and a `determined` `increment` of 1ms as

well).

The initial time value for every fake clock is read from the corresponding real clock at start

up.

Public Members

static const char[] Name_

Public Methods

void ~FakeClockControl ()
void Advance (::fuchsia::testing::Increment increment, AdvanceCallback callback)

Advances the fake clock `increment` once. This advances both monotonic and boot clocks by

the same amount.

Returns `ZX_ERR_INVALID_ARGS` if the provided `increment` is invalid (such as a badly formed

RandomRange). Returns `ZX_ERR_ACCESS_DENIED` if called while the FakeClock is free-running.

void IncrementMonoToBootOffsetBy (int64_t increment, IncrementMonoToBootOffsetByCallback callback)

Increments the mono-to-boot offset by the given `increment`. With real

clocks, the positive offset from monotonic clock to boot clock increases

during suspend. Here, this method fakes such an increase in offset.

`increment` must be a positive duration.

Returns `ZX_ERR_INVALID_ARGS` if the provided `increment` is not positive.

void ResumeWithIncrements (int64_t real, ::fuchsia::testing::Increment increment, ResumeWithIncrementsCallback callback)

Resumes free-running increments on the fake clock.

`real` is the period based on the real monotonic clock over which `increment` is going to be

applied. Returns `ZX_ERR_INVALID_ARGS` if the provided `increment` is invalid (such as a

badly formed RandomRange).

void AddStopPoint (::fuchsia::testing::deadline::DeadlineId deadline_id, ::fuchsia::testing::DeadlineEventType event_type, ::zx::eventpair on_stop, AddStopPointCallback callback)

Registers interest in a deadline event.

`deadline_id` and `event_type` identify the named deadline and the event associated with

the deadline. When the event occurs, FakeClock will signal `EVENTPAIR_SIGNALED` on

`on_stop`. If time is free-running, the clock is stopped. Closing the eventpair cancels

interest in the deadline. If the eventpair is closed when a deadline is reached, time is

not stopped. Note that only events that occur after `AddStopPoint` is called are matched.

In addition, the `EXPIRED` event is always reported, even if the component that created the

deadline does not act on the deadline expiration.

The intended use is to set a stop point using `AddStopPoint`, resume running time with

`ResumeWithIncrements`, then wait for the stop point to occur using the `on_stop`

eventpair.

Setting a stop point is only allowed while time is stopped. If time is free running when

this method is invoked `ZX_ERR_ACCESS_DENIED` is returned. If a stop point is already

registered for the same event, `ZX_ALREADY_BOUND` is returned.

void Pause (PauseCallback callback)

Pauses free-running increments on the fake clock.

void IgnoreNamedDeadline (::fuchsia::testing::deadline::DeadlineId deadline_id, IgnoreNamedDeadlineCallback callback)

Instructs the fake clock to make deadlines named `deadline_id` never expire.

This is a no-op if `deadline_id` is already in the ignored set.