From db23d2363722f587d9e16f8b1defe1332d8e1382 Mon Sep 17 00:00:00 2001 From: Nils Date: Wed, 28 Jul 2021 12:48:31 +0200 Subject: [PATCH] Another cleanup (removed poll entirely) --- CMakeLists.txt | 1 - inc/coro/coro.hpp | 1 - inc/coro/poll.hpp | 39 --------------------------------------- 3 files changed, 41 deletions(-) delete mode 100644 inc/coro/poll.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 54554d6..abc21b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,6 @@ set(LIBCROSSCORO_SOURCE_FILES inc/coro/generator.hpp inc/coro/latch.hpp inc/coro/mutex.hpp src/mutex.cpp - inc/coro/poll.hpp inc/coro/ring_buffer.hpp inc/coro/semaphore.hpp src/semaphore.cpp inc/coro/shared_mutex.hpp diff --git a/inc/coro/coro.hpp b/inc/coro/coro.hpp index d9a7b70..08ebc1e 100644 --- a/inc/coro/coro.hpp +++ b/inc/coro/coro.hpp @@ -10,7 +10,6 @@ #include "coro/generator.hpp" #include "coro/latch.hpp" #include "coro/mutex.hpp" -#include "coro/poll.hpp" #include "coro/ring_buffer.hpp" #include "coro/semaphore.hpp" #include "coro/shared_mutex.hpp" diff --git a/inc/coro/poll.hpp b/inc/coro/poll.hpp deleted file mode 100644 index 24ffd91..0000000 --- a/inc/coro/poll.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include - -namespace coro -{ -enum class poll_op : uint64_t -{ - /// Poll for read operations. - read = EPOLLIN, - /// Poll for write operations. - write = EPOLLOUT, - /// Poll for read and write operations. - read_write = EPOLLIN | EPOLLOUT -}; - -inline auto poll_op_readable(poll_op op) -> bool -{ - return (static_cast(op) & EPOLLIN); -} - -inline auto poll_op_writeable(poll_op op) -> bool -{ - return (static_cast(op) & EPOLLOUT); -} - -enum class poll_status -{ - /// The poll operation was was successful. - event, - /// The poll operation timed out. - timeout, - /// The file descriptor had an error while polling. - error, - /// The file descriptor has been closed by the remote or an internal error/close. - closed -}; - -} // namespace coro