From 382273abc53542de0e58ef47db1ab4634d09ea2f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 10 Sep 2020 15:20:21 +0200 Subject: [PATCH] io/uring/Operation: add API documentation --- src/io/uring/Operation.hxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/io/uring/Operation.hxx b/src/io/uring/Operation.hxx index 662d959f3..8f753b16f 100644 --- a/src/io/uring/Operation.hxx +++ b/src/io/uring/Operation.hxx @@ -36,6 +36,9 @@ namespace Uring { class CancellableOperation; +/** + * An asynchronous I/O operation to be queued in a #Queue instance. + */ class Operation { friend class CancellableOperation; @@ -46,12 +49,26 @@ public: CancelUring(); } + /** + * Are we waiting for the operation to complete? + */ bool IsUringPending() const noexcept { return cancellable != nullptr; } + /** + * Cancel the operation. OnUringCompletion() will not be + * invoked. This is a no-op if none is pending. + */ void CancelUring() noexcept; + /** + * This method is called when the operation completes. + * + * @param res the result code; the meaning is specific to the + * operation, but negative values usually mean an error has + * occurred + */ virtual void OnUringCompletion(int res) noexcept = 0; };