Skip to content

Struct hal::mock::timer

ClassList > hal > mock > timer

Mock timer implementation for use in unit tests and simulations with spy functions for schedule() , clear(), andis_running() __

  • #include <timer.hpp>

Inherits the following classes: hal::timer

Public Attributes

Type Name
spy_handler< bool > spy_cancel
Spy handler for hal::timer::clear()
spy_handler< bool > spy_is_running
Spy handler for hal::timer::is_running() __
spy_handler< std::function< void(void)>, std::chrono::nanoseconds > spy_schedule
Spy handler for hal::timer::schedule() __

Public Functions

Type Name
void reset ()
Reset spy information for schedule() , clear(), andis_running() __

Public Functions inherited from hal::timer

See hal::timer

Type Name
result< cancel_t > cancel ()
Stops a scheduled event from happening.
result< is_running_t > is_running ()
Determine if the timer is currently running.
result< schedule_t > schedule (hal::callback< void(void)> p_callback, hal::time_duration p_delay)
Schedule an callback be be executed after the delay time.
virtual ~timer () = default

Public Attributes Documentation

variable spy_cancel

spy_handler<bool> hal::mock::timer::spy_cancel;

variable spy_is_running

spy_handler<bool> hal::mock::timer::spy_is_running;

variable spy_schedule

spy_handler<std::function<void(void)>, std::chrono::nanoseconds> hal::mock::timer::spy_schedule;

Public Functions Documentation

function reset

inline void hal::mock::timer::reset () 

The documentation for this class was generated from the following file libraries/include/libhal-mock/timer.hpp