From 5f5be823f385d508fbbb07b45173ebaa4bcfc19f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 17 Feb 2018 08:49:35 +0100 Subject: [PATCH] input/RemoteTagScanner: add API documentation --- src/input/RemoteTagScanner.hxx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/input/RemoteTagScanner.hxx b/src/input/RemoteTagScanner.hxx index 6198570bd..0ebe0b005 100644 --- a/src/input/RemoteTagScanner.hxx +++ b/src/input/RemoteTagScanner.hxx @@ -24,12 +24,35 @@ struct Tag; +/** + * Handler for the #RemoteTagScanner result. It will call one of the + * methods upon completion. Must be thread-safe. + */ class RemoteTagHandler { public: + /** + * Called on success. + */ virtual void OnRemoteTag(Tag &&tag) noexcept = 0; + + /** + * Called on error. + */ virtual void OnRemoteTagError(std::exception_ptr e) noexcept = 0; }; +/** + * This class can load tags of a remote file. It is created by + * InputPlugin::scan_tags(), and the #RemoteTagHandler will be called + * upon completion. + * + * To start the operation, call Start(). + * + * You can cancel the operation at any time by destructing this + * object; after successful cancellation, the handler will not be + * invoked, though it cannot be guaranteed that the handler is not + * already being called in another thread. + */ class RemoteTagScanner { public: virtual ~RemoteTagScanner() noexcept = default;