You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
544 B
C
24 lines
544 B
C
3 years ago
|
// Copyright (c) Vitaliy Filippov, 2019+
|
||
2 years ago
|
// License: VNPL-1.1 or GNU GPL-2.0+ (see README.md for details)
|
||
3 years ago
|
|
||
3 years ago
|
#pragma once
|
||
|
|
||
|
#include <map>
|
||
|
|
||
|
#include "ringloop.h"
|
||
|
#include "timerfd_manager.h"
|
||
|
|
||
|
class epoll_manager_t
|
||
|
{
|
||
|
int epoll_fd;
|
||
|
ring_loop_t *ringloop;
|
||
|
std::map<int, std::function<void(int, int)>> epoll_handlers;
|
||
|
public:
|
||
|
epoll_manager_t(ring_loop_t *ringloop);
|
||
|
~epoll_manager_t();
|
||
3 years ago
|
void set_fd_handler(int fd, bool wr, std::function<void(int, int)> handler);
|
||
3 years ago
|
void handle_epoll_events();
|
||
|
|
||
|
timerfd_manager_t *tfd;
|
||
|
};
|