diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-09-09 01:43:13 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-09-09 01:43:13 +0800 |
commit | 429905d4e893f91618908773166ba867970c9a17 (patch) | |
tree | f87fc7a6ed6ce345a6795d059426d9a60f50c3c3 /include | |
parent | 37d9a034013b4245a50c0d748dc83d2c3d136210 (diff) | |
download | cru-429905d4e893f91618908773166ba867970c9a17.tar.gz cru-429905d4e893f91618908773166ba867970c9a17.tar.bz2 cru-429905d4e893f91618908773166ba867970c9a17.zip |
Implement SetPoll of event loop.
Diffstat (limited to 'include')
-rw-r--r-- | include/cru/base/platform/unix/EventLoop.h | 7 |
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: |