Skip to content
Snippets Groups Projects
Commit 84740bd9 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

DOC: add docstrings

parent f371a542
No related branches found
No related tags found
1 merge request!11F files
......@@ -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,
......
......@@ -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;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment