-
Notifications
You must be signed in to change notification settings - Fork 82
/
handlertask.hh
70 lines (45 loc) · 1.23 KB
/
handlertask.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// -*- c-basic-offset: 4 -*-
#ifndef CLICK_HANDLERTASK_HH
#define CLICK_HANDLERTASK_HH
#include <click/element.hh>
#include <click/task.hh>
#include <click/handlercall.hh>
CLICK_DECLS
/*
=c
HandlerTask(HANDLER, [<keyword> LIMIT, STOP, ACTIVE])
=s test
associated with a do-nothing Task
=d
HandlerTask simply schedule a task which, when scheduled, does nothing.
This can be useful for benchmarking.
=over 8
=item ACTIVE
Boolean. If false, HandlerTask will not schedule itself at initialization
time. Use the C<scheduled> write handler to schedule the task later. Default
is true.
=item RESCHEDULE
Boolean. If true, HandlerTask will reschedule itself each time it runs.
Default is false.
=back
=h count r
Returns the number of times the element has been scheduled.
=a
ScheduleInfo
*/
class HandlerTask : public Element { public:
HandlerTask() CLICK_COLD;
const char *class_name() const override { return "HandlerTask"; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
int initialize(ErrorHandler *) CLICK_COLD;
void add_handlers() CLICK_COLD;
bool run_task(Task *);
private:
Task _task;
HandlerCall _h;
uint32_t _count;
bool _active;
bool _reschedule;
};
CLICK_ENDDECLS
#endif