1 #ifndef LIBFILEZILLA_AIO_HEADER
2 #define LIBFILEZILLA_AIO_HEADER
8 #include "../event.hpp"
9 #include "../event_handler.hpp"
10 #include "../mutex.hpp"
11 #include "../nonowning_buffer.hpp"
17 class aio_buffer_pool;
40 explicit operator bool()
const {
return pool_ !=
nullptr; }
81 void remove_waiters();
86 void signal_availibility();
91 std::vector<event_handler*> waiting_handlers_;
95 struct aio_buffer_event_type{};
97 typedef simple_event<aio_buffer_event_type, aio_waitable const*> aio_buffer_event;
99 class logger_interface;
116 ~aio_buffer_pool() noexcept;
118 operator bool()
const {
119 return memory_ !=
nullptr;
136 typedef void* shm_handle;
137 static shm_handle
const shm_handle_default;
140 typedef int shm_handle;
141 static shm_handle constexpr shm_handle_default{-1};
163 std::tuple<shm_handle, uint8_t const*, size_t> shared_memory_info()
const;
165 size_t buffer_count()
const {
return buffer_count_; }
178 uint64_t memory_size_{};
181 std::vector<nonowning_buffer> buffers_;
183 shm_handle shm_{shm_handle_default};
185 size_t const buffer_count_{};
205 virtual ~
aio_base() noexcept =
default;
207 using size_type = uint64_t;
208 static constexpr
auto nosize =
static_cast<size_type
>(-1);
Similar to fz::buffer, but does not own memory.
Definition: nonowning_buffer.hpp:22
Definition: event_handler.hpp:60
aio_result
Result of aio operations.
Definition: aio.hpp:189
A buffer pool for use with async readers/writers.
Definition: aio.hpp:106
A threaded event loop that supports sending events and timers.
Definition: event_loop.hpp:33
The namespace used by libfilezilla.
Definition: apply.hpp:17
Lean replacement for std::(recursive_)mutex.
Definition: mutex.hpp:74
A dumb thread-pool for asynchronous tasks.
Definition: thread_pool.hpp:63
Abstract interface for logging strings.
Definition: logger.hpp:50