Lely core libraries
2.2.5
timer.hpp
Go to the documentation of this file.
1
24
#ifndef LEYL_IO2_SYS_TIMER_HPP_
25
#define LEYL_IO2_SYS_TIMER_HPP_
26
27
#include <
lely/io2/sys/timer.h
>
28
#include <
lely/io2/timer.hpp
>
29
30
#include <utility>
31
32
namespace
lely {
33
namespace
io {
34
36
class
Timer
:
public
TimerBase
{
37
public
:
39
Timer
(
io_poll_t
* poll,
ev_exec_t
* exec, clockid_t clockid)
40
:
TimerBase
(
io_timer_create
(poll, exec, clockid)) {
41
if
(!timer) util::throw_errc(
"Timer"
);
42
}
43
44
Timer
(
const
Timer
&) =
delete
;
45
46
Timer
(
Timer
&& other) noexcept :
TimerBase
(other.timer) {
47
other.timer =
nullptr
;
48
other.dev =
nullptr
;
49
}
50
51
Timer
& operator=(
const
Timer
&) =
delete
;
52
53
Timer
&
54
operator=(
Timer
&& other) noexcept {
55
using ::std::swap;
56
swap(timer, other.timer);
57
swap(dev, other.dev);
58
return
*
this
;
59
}
60
62
~Timer
() {
io_timer_destroy
(*
this
); }
63
};
64
65
}
// namespace io
66
}
// namespace lely
67
68
#endif // !LEYL_IO2_SYS_TIMER_HPP_
ev_exec_t
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
Definition:
ev.h:29
lely::io::TimerBase
A reference to an abstract timer.
Definition:
timer.hpp:130
io_timer_create
io_timer_t * io_timer_create(io_poll_t *poll, ev_exec_t *exec, clockid_t clockid)
Creates a new I/O system timer.
Definition:
timer.c:239
timer.hpp
lely::io::Timer::Timer
Timer(io_poll_t *poll, ev_exec_t *exec, clockid_t clockid)
Definition:
timer.hpp:39
__io_poll
An I/O polling interface.
Definition:
poll.c:48
timer.h
lely::io::Timer
An I/O system timer.
Definition:
timer.hpp:36
io_timer_destroy
void io_timer_destroy(io_timer_t *timer)
Destroys an I/O system timer.
Definition:
timer.c:266
lely::io::Timer::~Timer
~Timer()
Definition:
timer.hpp:62
include
lely
io2
sys
timer.hpp
Generated by
1.8.17