diff --git a/include/caosdb/file_transmission/download_request_handler.h b/include/caosdb/file_transmission/download_request_handler.h index c6ee1c36b67c637c8faad901f590a4eee318b7b5..cb2108aa3c9c091316e557c1d732297d84171db9 100644 --- a/include/caosdb/file_transmission/download_request_handler.h +++ b/include/caosdb/file_transmission/download_request_handler.h @@ -68,6 +68,9 @@ using caosdb::entity::v1alpha1::FileTransmissionService; using caosdb::transaction::HandlerInterface; using caosdb::transaction::HandlerTag; +/* + * Handler for the download request of a single file + */ class DownloadRequestHandler final : public HandlerInterface { public: DownloadRequestHandler(HandlerTag tag, FileTransmissionService::Stub *stub, diff --git a/include/caosdb/handler_interface.h b/include/caosdb/handler_interface.h index 4ba563a300175478c8140e9b88c991e2f5321245..ee38b38225dda6a903c89a239384ea96b2847c07 100644 --- a/include/caosdb/handler_interface.h +++ b/include/caosdb/handler_interface.h @@ -56,7 +56,14 @@ namespace caosdb::transaction { const static std::string logger_name = "caosdb::transaction"; - +/* + * Baseclass for UnaryRpcHandler, DownloadRequestHandler and + * UploadRequestHandler + * + * It handles a request: Its status is contained in the transaction_status + * member variable and the functions Start, OnNext and Cancel need to be + * overwritten by child classes. + */ class HandlerInterface { public: HandlerInterface() : transaction_status(TransactionStatus::READY()) {} @@ -65,6 +72,12 @@ public: virtual void Start() = 0; + /* + * ok indicates whether the current request is in a good state or not. If + * ok is false, the request will be ended. + * + * returns false if the handler is done + */ virtual bool OnNext(bool ok) = 0; virtual void Cancel() = 0; diff --git a/include/caosdb/transaction.h b/include/caosdb/transaction.h index 368eb2e10d311ce862cce09c8c417c54da379a5a..bda5bb355b5dc317e6727c8bcea5ac10450e582f 100644 --- a/include/caosdb/transaction.h +++ b/include/caosdb/transaction.h @@ -432,6 +432,8 @@ public: protected: /** * Await and process the current handler's results. + * + * This implies consecutive calls to the handler's OnNext function. */ auto ProcessCalls() -> TransactionStatus;