Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::gpu::metal::TestProgressClock Class Reference

A steady clock that a test moves by hand, in place of the system's steady clock, for the devices it is installed on with MetalDevice::setProgressClockForTest. More...

#include "donner/gpu/metal/MetalDevice.h"

Public Types

using Clock = std::chrono::steady_clock
 The clock whose time points it reports.

Public Member Functions

 TestProgressClock (const TestProgressClock &)=delete
TestProgressClock & operator= (const TestProgressClock &)=delete
Clock::time_point now () const
 The current time on this clock.
void advance (Clock::duration duration)
 Moves this clock forward by duration, then wakes every wait on the devices it is installed on. When this returns, any look a wait takes at the time it judges by sees the new time.

Friends

class MetalDevice

Detailed Description

A steady clock that a test moves by hand, in place of the system's steady clock, for the devices it is installed on with MetalDevice::setProgressClockForTest.

It starts at the steady clock's reading when it is constructed and then moves only when advance is called, so a case decides exactly how much time a wait sees pass between the events it orders, however slowly a loaded machine runs them. Advancing it wakes every wait on the devices it is installed on, which then judges its bounds again at the new time.

Thread-safe: any thread may read or advance it, including the GPU's completion handlers, which read it to stamp progress.

Member Function Documentation

◆ advance()

void donner::gpu::metal::TestProgressClock::advance ( Clock::duration duration)

Moves this clock forward by duration, then wakes every wait on the devices it is installed on. When this returns, any look a wait takes at the time it judges by sees the new time.

Parameters
durationHow far to move; a negative duration is ignored.

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