uvw
3.4.0
Loading...
Searching...
No Matches
src
uvw
timer.h
1
#ifndef UVW_TIMER_INCLUDE_H
2
#define UVW_TIMER_INCLUDE_H
3
4
#include <cstdint>
5
#include <chrono>
6
#include <uv.h>
7
#include "handle.hpp"
8
#include "loop.h"
9
10
namespace
uvw
{
11
13
struct
timer_event
{};
14
22
class
timer_handle
final:
public
handle
<timer_handle, uv_timer_t, timer_event> {
23
static
void
start_callback(uv_timer_t *hndl);
24
25
public
:
26
using
time = std::chrono::duration<uint64_t, std::milli>;
27
28
using
handle::handle;
29
34
int
init
();
35
50
int
start
(time timeout, time
repeat
);
51
56
int
stop
();
57
66
int
again
();
67
86
void
repeat
(time
repeat
);
87
93
time
repeat
();
94
102
time
due_in
();
103
};
104
105
}
// namespace uvw
106
107
#ifndef UVW_AS_LIB
108
# include "timer.cpp"
109
#endif
110
111
#endif
// UVW_TIMER_INCLUDE_H
uvw::handle
Handle base class.
Definition
handle.hpp:23
uvw::timer_handle
The timer handle.
Definition
timer.h:22
uvw::timer_handle::repeat
void repeat(time repeat)
Sets the repeat interval value.
uvw::timer_handle::stop
int stop()
Stops the handle.
uvw::timer_handle::init
int init()
Initializes the handle.
uvw::timer_handle::again
int again()
Stops the timer and restarts it if it was repeating.
uvw::timer_handle::due_in
time due_in()
Gets the timer due value.
uvw::timer_handle::repeat
time repeat()
Gets the timer repeat value.
uvw::timer_handle::start
int start(time timeout, time repeat)
Starts the timer.
uvw
uvw default namespace.
Definition
async.h:8
uvw::timer_event
Timer event.
Definition
timer.h:13
Generated by
1.13.2