6 #ifndef IOURINGIMP_HPP_INCLUDE
7 #define IOURINGIMP_HPP_INCLUDE
9 #ifndef _DEFAULT_SOURCE
11 #define _DEFAULT_SOURCE
33 void prep_read(std::shared_ptr<int> ret,
int fd,
34 void *buf,
unsigned nbytes, off_t offset)
override;
36 void prep_write(std::shared_ptr<int> ret,
int fd,
37 const void *buf,
unsigned nbytes, off_t offset)
override;
45 static std::unique_ptr<IOUring>
make_unique(
unsigned entries);
49 struct io_uring_sqe *sqe,
50 std::shared_ptr<int> destination);
53 struct io_uring m_ring;
54 std::vector<std::shared_ptr<int> > m_result_destinations;
Definition: IOUring.hpp:18
Implementation of the IOUring batch interface. This implementation batches operations inside io_uring...
Definition: IOUringImp.hpp:24
IOUringImp(const IOUringImp &other)=delete
void prep_read(std::shared_ptr< int > ret, int fd, void *buf, unsigned nbytes, off_t offset) override
Perform a pread in the next batch submission.
Definition: IOUringImp.cpp:86
static std::unique_ptr< IOUring > make_unique(unsigned entries)
Create an IO uring with queues of a given size.
Definition: IOUringImp.cpp:123
void prep_write(std::shared_ptr< int > ret, int fd, const void *buf, unsigned nbytes, off_t offset) override
Perform a pwrite in the next batch submission.
Definition: IOUringImp.cpp:95
IOUringImp(unsigned entries)
Definition: IOUringImp.cpp:17
void submit() override
Submit all prepared uring operations in a batch, and wait for all operations to return a result....
Definition: IOUringImp.cpp:57
struct io_uring_sqe * get_sqe_or_throw()
Definition: IOUringImp.cpp:34
static bool is_supported()
Return whether this implementation of IOUring is supported.
Definition: IOUringImp.cpp:104
IOUringImp & operator=(const IOUringImp &other)=delete
virtual ~IOUringImp()
Definition: IOUringImp.cpp:29
void set_sqe_return_destination(struct io_uring_sqe *sqe, std::shared_ptr< int > destination)
Definition: IOUringImp.cpp:44