1#ifndef LIBFILEZILLA_AIO_HEADER
2#define LIBFILEZILLA_AIO_HEADER
40 explicit operator bool()
const {
return pool_ !=
nullptr; }
86 void signal_availibility();
91 std::vector<event_handler*> waiting_handlers_;
95struct aio_buffer_event_type{};
97typedef simple_event<aio_buffer_event_type, aio_waitable const*> aio_buffer_event;
99class logger_interface;
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};
165 size_t buffer_count()
const {
return buffer_count_; }
170 friend class buffer_lease;
171 void FZ_PRIVATE_SYMBOL release(nonowning_buffer && b);
174 logger_interface & logger_;
178 uint64_t memory_size_{};
181 std::vector<nonowning_buffer> buffers_;
183 shm_handle shm_{shm_handle_default};
185 size_t const buffer_count_{};
207 using size_type = uint64_t;
208 static constexpr auto nosize =
static_cast<size_type
>(-1);
A buffer pool for use with async readers/writers.
Definition aio.hpp:107
std::tuple< shm_handle, uint8_t const *, size_t > shared_memory_info() const
buffer_lease get_buffer(event_handler &h)
Returns either a buffer lease, or records the passed waiter/handler as waiting.
void remove_waiter(event_handler &h)
void remove_waiters()
Call in destructor of most-derived class.
Simple handler for asynchronous event processing.
Definition event_handler.hpp:55
A threaded event loop that supports sending events and timers.
Definition event_loop.hpp:34
Abstract interface for logging strings.
Definition logger.hpp:51
Lean replacement for std::(recursive_)mutex.
Definition mutex.hpp:52
Similar to fz::buffer, but does not own memory.
Definition nonowning_buffer.hpp:23
A dumb thread-pool for asynchronous tasks.
Definition thread_pool.hpp:64
Declares event_base and simple_event<>
Declares the event_handler class.
Thread synchronization primitives: mutex, scoped_lock and condition.
The namespace used by libfilezilla.
Definition apply.hpp:17
aio_result
Result of aio operations.
Definition aio.hpp:190
@ error
Operationf failed.
Declares fz::nonowning_buffer.