5#include <click/glue.hh>
11typedef void (*TimerCallback)(
Timer *timer,
void *user_data);
12typedef TimerCallback TimerHook CLICK_DEPRECATED;
32 Timer(
const do_nothing_t &unused);
38 Timer(TimerCallback f,
void *user_data);
63 _hook.callback = do_nothing_hook;
68 inline void assign(
const do_nothing_t &unused) {
76 inline void assign(TimerCallback f,
void *user_data) {
85 _hook.callback = element_hook;
92 _hook.callback = task_hook;
104 return _schedpos1 != 0;
308#if TIMESTAMP_WARPABLE
309 if (Timestamp::warp_jumping())
340 enum { behind_sec = 1 };
347 TimerCallback callback;
355 static void do_nothing_hook(
Timer *t,
void *user_data);
356 static void element_hook(
Timer *t,
void *user_data);
357 static void task_hook(
Timer *t,
void *user_data);
359 friend class TimerSet;
Base class for Click elements.
Definition element.hh:42
Router * router() const
Return the element's router.
Definition element.hh:515
A router configuration.
Definition router.hh:28
A set of Tasks scheduled on the same CPU.
Definition routerthread.hh:32
Represents a frequently-scheduled computational task.
Definition task.hh:49
Triggers execution at a given time.
Definition timer.hh:14
void schedule_after(const Timestamp &delta)
Schedule the timer to fire delta time in the future.
Definition timer.cc:310
~Timer()
Destroy a Timer, unscheduling it first if necessary.
Definition timer.hh:55
void reschedule_at(const Timestamp &when)
Schedule the timer to fire at when.
Definition timer.hh:370
Element * element() const
Return the Timer's owning element.
Definition timer.hh:144
void schedule_at(const Timestamp &when)
Schedule the timer to fire at when.
Definition timer.hh:364
void assign()
Change the Timer to do nothing when fired.
Definition timer.hh:62
bool scheduled() const
Return true iff the Timer is currently scheduled.
Definition timer.hh:103
int home_thread_id() const
Return the Timer's associated home thread ID.
Definition timer.cc:258
void reschedule_after_ms(uint32_t delta_sec)
Schedule the timer to fire delta_msec milliseconds after its previous expiry time (deprecated).
Definition timer.hh:394
void schedule_at_steady(const Timestamp &when_steady)
Schedule the timer to fire at when_steady.
Definition timer.cc:273
void move_thread(int tid)
Change the home thread. Will only apply at next schedule.
Definition timer.cc:267
void reschedule_at_steady(const Timestamp &when_steady)
Schedule the timer to fire at when_steady.
RouterThread * thread() const
Return the Timer's associated RouterThread.
Definition timer.hh:149
static Timestamp adjustment()
Return an adjustment interval useful for precise timers.
Definition timer.hh:307
Timer()
Construct a Timer that does nothing when fired.
Definition timer.cc:195
void assign(Element *element)
Change the Timer to call element ->run_timer(this) when fired.
Definition timer.hh:84
void schedule_after_msec(uint32_t delta_msec)
Schedule the timer to fire after delta_msec milliseconds.
Definition timer.hh:250
void clear()
Unschedule the timer and reset its expiration time.
Definition timer.hh:291
void reschedule_after_sec(uint32_t delta_sec)
Schedule the timer to fire delta_sec seconds after its previous expiry.
Definition timer.hh:271
void schedule_after_ms(uint32_t delta_sec)
Schedule the timer to fire after delta_msec milliseconds (deprecated).
Definition timer.hh:382
bool initialized() const
Return true iff the Timer has been initialized.
Definition timer.hh:98
void reschedule_after_s(uint32_t delta_sec)
Schedule the timer to fire delta_sec seconds after its previous expiry time (deprecated).
Definition timer.hh:388
void reschedule_after(const Timestamp &delta)
Schedule the timer to fire delta time after its previous expiry.
Definition timer.hh:262
void assign(TimerCallback f, void *user_data)
Change the Timer to call f(this, user_data) when fired.
Definition timer.hh:76
const Timestamp & expiry_steady() const
Return the Timer's steady-clock expiration time.
Definition timer.hh:116
void schedule_now()
Shedule the timer to fire immediately.
Definition timer.hh:224
void schedule_after_s(uint32_t delta_sec)
Schedule the timer to fire after delta_sec seconds (deprecated).
Definition timer.hh:376
void assign(Task *task)
Change the Timer to schedule task when fired.
Definition timer.hh:91
void assign(const do_nothing_t &unused)
Change the Timer to do nothing when fired.
Definition timer.hh:68
void initialize(Element *owner, bool quiet=false)
Initialize the timer.
Definition timer.cc:238
void reschedule_after_msec(uint32_t delta_msec)
Schedule the timer to fire delta_msec milliseconds after its previous expiry.
Definition timer.hh:280
Timestamp expiry() const
Return the Timer's system-clock expiration time.
Definition timer.hh:131
void schedule_after_sec(uint32_t delta_sec)
Schedule the timer to fire after delta_sec seconds.
Definition timer.hh:242
Router * router() const
Return the Timer's associated Router.
Definition timer.hh:139
void unschedule()
Unschedule the timer.
Definition timer.cc:316
Represents a moment or interval in time.
Definition timestamp.hh:125
static Timestamp recent_steady()
Return a recent steady-clock time.
Definition timestamp.hh:1000
static Timestamp make_usec(seconds_type sec, uint32_t usec)
Return a timestamp representing sec seconds plus usec microseconds.
Definition timestamp.hh:349
static Timestamp make_msec(seconds_type sec, uint32_t msec)
Return a timestamp representing sec seconds plus msec milliseconds.
Definition timestamp.hh:332
seconds_type sec() const
Return this timestamp's seconds component.
Definition timestamp.hh:1075
uint32_t subsec() const
Return this timestamp's subseconds component.
Definition timestamp.hh:1089
static Timestamp recent()
Return a recent system time.
Definition timestamp.hh:972
Classes for synchronizing among multiple CPUs, particularly in the Linux kernel.
The Timestamp class represents a moment or interval in time.