#include "mock_timer.h"
Public Member Functions | |
Alarm (int64 wakeup_time_us, Function *closure) | |
int64 | wakeup_time_us () const |
int | Compare (const Alarm *that) const |
Function * | closure () |
void | CallRun () |
void | CallCancel () |
Friends | |
class | MockTimer |
Alarms provide a mechanism for tests employing mock timers to get notified when a certain mock-time passes. When a MockTimer::set_time_us is called (or any of the other functions that adjust time), time advances in phases broken up by outstanding alarms, so that the system is seen in a consistent state.
int net_instaweb::MockTimer::Alarm::Compare | ( | const Alarm * | that | ) | const |
Compares two alarms, giving a total deterministic ordering based first, on wakeup time, and, in the event of two simultaneous alarms, the order in which the Alarm was added.