aboutsummaryrefslogtreecommitdiff
path: root/include/cru/base/platform
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-09-09 01:43:13 +0800
committerYuqian Yang <crupest@crupest.life>2025-09-09 01:43:13 +0800
commit429905d4e893f91618908773166ba867970c9a17 (patch)
treef87fc7a6ed6ce345a6795d059426d9a60f50c3c3 /include/cru/base/platform
parent37d9a034013b4245a50c0d748dc83d2c3d136210 (diff)
downloadcru-429905d4e893f91618908773166ba867970c9a17.tar.gz
cru-429905d4e893f91618908773166ba867970c9a17.tar.bz2
cru-429905d4e893f91618908773166ba867970c9a17.zip
Implement SetPoll of event loop.
Diffstat (limited to 'include/cru/base/platform')
-rw-r--r--include/cru/base/platform/unix/EventLoop.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/cru/base/platform/unix/EventLoop.h b/include/cru/base/platform/unix/EventLoop.h
index 1fea6598..4f445fa3 100644
--- a/include/cru/base/platform/unix/EventLoop.h
+++ b/include/cru/base/platform/unix/EventLoop.h
@@ -47,8 +47,9 @@ class UnixTimerFile : public Object2 {
class UnixEventLoop : public Object2 {
CRU_DEFINE_CLASS_LOG_TAG("cru::platform::unix::UnixEventLoop")
public:
- using PollHandler =
- std::function<void(decltype(std::declval<pollfd>().revents) revent)>;
+ using PollEvents = decltype(std::declval<pollfd>().events);
+ using PollRevents = decltype(std::declval<pollfd>().revents);
+ using PollHandler = std::function<void(PollEvents revent)>;
UnixEventLoop();
@@ -79,7 +80,7 @@ class UnixEventLoop : public Object2 {
return this->SetTimer(std::move(action), std::move(interval), true);
}
- void AddPoll(int fd, PollHandler action);
+ void SetPoll(int fd, PollEvents events, PollHandler action);
void RemovePoll(int fd);
private: