From 429905d4e893f91618908773166ba867970c9a17 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Tue, 9 Sep 2025 01:43:13 +0800 Subject: Implement SetPoll of event loop. --- include/cru/base/platform/unix/EventLoop.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/cru') 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().revents) revent)>; + using PollEvents = decltype(std::declval().events); + using PollRevents = decltype(std::declval().revents); + using PollHandler = std::function; 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: -- cgit v1.2.3