9 #ifndef INCLUDE_FUNAPI_TIME_TIMER_H_ 10 #define INCLUDE_FUNAPI_TIME_TIMER_H_ 12 #include <boost/function.hpp> 13 #include <boost/thread/thread_time.hpp> 14 #include <boost/utility.hpp> 24 FUNAPI_DLL_VISIBILITY
extern const EventTag kTimerEventTag;
34 typedef function<void (const Id &, const WallClock::Value &)>
Handler;
38 static bool Uninstall();
46 const WallClock::Value &abs_time,
47 const Handler &handler,
48 const EventTag &tag = kTimerEventTag) ASSERT_NO_ROLLBACK;
55 static Id ExpireAfter(
56 const WallClock::Duration &rel_time,
57 const Handler &handler,
58 const EventTag &tag = kTimerEventTag) ASSERT_NO_ROLLBACK;
65 static Id ExpireRepeatedly(
66 const WallClock::Duration &interval,
67 const Handler &handler,
68 const EventTag &tag = kTimerEventTag) ASSERT_NO_ROLLBACK;
73 static void Cancel(
const Id &timer_id) ASSERT_NO_ROLLBACK;
81 #endif // INCLUDE_FUNAPI_TIME_TIMER_H_
ArgumentMap class manages application-specific run-time arguments.
Definition: argument_map.h:23
Timer singleton.
Definition: timer.h:28
Base class for any service in Funapi.
Definition: component.h:20
static const Id kInvalidTimerId
invalid timer id.
Definition: timer.h:76
function< void(const Id &, const WallClock::Value &)> Handler
Handler that is called when a timer gets fired.
Definition: timer.h:34
Uuid EventTag
Event Tag.
Definition: event.h:30
uint64_t Id
Id to identify timers.
Definition: timer.h:31