1#ifndef LIBFILEZILLA_AIO_HEADER
2#define LIBFILEZILLA_AIO_HEADER
39 explicit operator bool()
const {
return pool_ !=
nullptr; }
108 void signal_availibility();
114 std::vector<aio_waiter*> waiting_;
115 std::vector<event_handler*> waiting_handlers_;
116 std::vector<aio_waiter*> active_signalling_;
120struct aio_buffer_event_type{};
124class logger_interface;
143 operator bool()
const {
144 return memory_ !=
nullptr;
162 typedef void* shm_handle;
163 static shm_handle
const shm_handle_default;
166 typedef int shm_handle;
167 static shm_handle
constexpr shm_handle_default{-1};
191 size_t buffer_count()
const {
return buffer_count_; }
204 std::vector<nonowning_buffer> buffers_;
206 shm_handle shm_{shm_handle_default};
208 size_t const buffer_count_{};
231 static constexpr auto nosize =
static_cast<size_type
>(-1);
A buffer pool for use with async readers/writers.
Definition aio.hpp:132
std::tuple< shm_handle, uint8_t const *, size_t > shared_memory_info() const
buffer_lease get_buffer(aio_waiter &h)
Returns either a buffer lease, or records the passed waiter/handler as waiting.
void remove_waiters()
Call in destructor of most-derived class.
void remove_waiter(aio_waiter &h)
virtual void on_buffer_availability(aio_waitable const *w)=0
Simple handler for asynchronous event processing.
Definition event_handler.hpp:55
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
Declares event_base and simple_event<>
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:213
@ error
Operationf failed.
bool dispatch(event_base const &ev, F &&f)
Dispatch for simple_event<> based events to simple functors.
Definition event_handler.hpp:199
Declares fz::nonowning_buffer.