nngn
Loading...
Searching...
No Matches
poller.h
Go to the documentation of this file.
1
#ifndef NNGN_SCRIPTS_WORKER_H
2
#define NNGN_SCRIPTS_WORKER_H
3
4
#include <array>
5
#include <poll.h>
6
7
class
Poller
{
8
std::array<int, 2>
pipe_fds
= {-1, -1};
9
std::array<pollfd, 2>
poll_fds
= {};
10
public
:
11
enum class
result
: uint8_t {
ERR
,
DONE
,
CANCELLED
,
READ
};
12
bool
init
();
13
bool
destroy
();
14
bool
finish
();
15
result
poll
(
int
fd
);
16
};
17
18
#endif
Poller
Definition
poller.h:7
Poller::pipe_fds
std::array< int, 2 > pipe_fds
Definition
poller.h:8
Poller::poll_fds
std::array< pollfd, 2 > poll_fds
Definition
poller.h:9
Poller::destroy
bool destroy()
Definition
poller.cpp:25
Poller::finish
bool finish()
Definition
poller.cpp:35
Poller::init
bool init()
Definition
poller.cpp:13
Poller::poll
result poll(int fd)
Definition
poller.cpp:44
Poller::result
result
Definition
poller.h:11
Poller::result::DONE
@ DONE
Poller::result::READ
@ READ
Poller::result::CANCELLED
@ CANCELLED
Poller::result::ERR
@ ERR
fd
std::chrono::duration< float, typename T::period > fd
Definition
timing.cpp:8
tools
poller.h
Generated by
1.11.0