LLFIO  v2.00
llfio_v2_xxx::byte_io_multiplexer::_synchronised_io_operation_state Struct Reference

A synchronised i/o operation state. More...

#include "byte_io_multiplexer.hpp"

Inheritance diagram for llfio_v2_xxx::byte_io_multiplexer::_synchronised_io_operation_state:
llfio_v2_xxx::byte_io_multiplexer::_unsynchronised_io_operation_state llfio_v2_xxx::byte_io_multiplexer::io_operation_state

Public Member Functions

 _synchronised_io_operation_state (const _synchronised_io_operation_state &)=delete
 
virtual io_operation_state_type current_state () const noexcept override
 Used to retrieve the current state of the i/o operation.
 
virtual io_result< buffers_typeget_completed_read () &&noexcept override
 After an i/o operation has finished, can be used to retrieve the result if the visitor did not.
 
virtual io_result< const_buffers_typeget_completed_write_or_barrier () &&noexcept override
 After an i/o operation has finished, can be used to retrieve the result if the visitor did not.
 
virtual void * invoke (function_ptr< void *(io_operation_state_type)> c) const noexcept override
 Invoke the callable with the per-i/o state lock held, if any.
 
virtual void read_initiated () override
 
virtual void read_completed (io_result< buffers_type > &&res) override
 
virtual void read_finished () override
 
virtual void write_initiated () override
 
virtual void write_completed (io_result< const_buffers_type > &&res) override
 
virtual void barrier_initiated () override
 
virtual void barrier_completed (io_result< const_buffers_type > &&res) override
 
virtual void write_or_barrier_finished () override
 
constexpr _unsynchronised_io_operation_state ()
 Construct an unknown state.
 
 _unsynchronised_io_operation_state (byte_io_handle *_h, io_operation_state_visitor *_v, registered_buffer_type &&b, deadline d, io_request< buffers_type > reqs)
 Construct a read operation state.
 
 _unsynchronised_io_operation_state (byte_io_handle *_h, io_operation_state_visitor *_v, registered_buffer_type &&b, deadline d, io_request< const_buffers_type > reqs)
 Construct a write operation state.
 
 _unsynchronised_io_operation_state (byte_io_handle *_h, io_operation_state_visitor *_v, registered_buffer_type &&b, deadline d, io_request< const_buffers_type > reqs, barrier_kind kind)
 Construct a barrier operation state.
 
 _unsynchronised_io_operation_state (io_result< buffers_type > &&res)
 Construct a finished read operation state.
 
 _unsynchronised_io_operation_state (io_result< const_buffers_type > &&res)
 Construct a finished write or barrier operation state.
 
 _unsynchronised_io_operation_state (const _unsynchronised_io_operation_state &)=delete
 
 _unsynchronised_io_operation_state (_unsynchronised_io_operation_state &&o) noexcept
 
void clear_storage ()
 Used to clear the storage in this operation state.
 
virtual io_operation_staterelocate_to (byte *to_) noexcept override
 Relocate the state to new storage, clearing the original state. Terminates the process if the state is in use.
 
void _read_initiated (lock_guard &g)
 
void _read_completed (lock_guard &g, io_result< buffers_type > &&res)
 
void _read_finished (lock_guard &g)
 
void _write_initiated (lock_guard &g)
 
void _write_completed (lock_guard &g, io_result< const_buffers_type > &&res)
 
void _barrier_initiated (lock_guard &g)
 
void _barrier_completed (lock_guard &g, io_result< const_buffers_type > &&res)
 
void _write_or_barrier_finished (lock_guard &g)
 

Public Attributes

spinlock _lock_
 
io_operation_state_type state {io_operation_state_type::unknown}
 The current lifecycle state of this i/o operation.
 
union llfio_v2_xxx::byte_io_multiplexer::_unsynchronised_io_operation_state::payload_t payload
 
byte_io_handleh {nullptr}
 The i/o handle the i/o operation is upon.
 
io_operation_state_visitorvisitor {nullptr}
 The state visitor supplied when the operation was initialised.
 

Protected Member Functions

 _synchronised_io_operation_state (_synchronised_io_operation_state &&)=default
 
virtual void _lock () noexcept override
 
virtual void _unlock () noexcept override
 

Detailed Description

A synchronised i/o operation state.

This implementation uses an atomic to synchronise access during the *_completed(), *_finished() and current_state() member functions, thus making it suitable for use across threads.


The documentation for this struct was generated from the following file: