aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storageapi/messageapi/storagereply.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/src/vespa/storageapi/messageapi/storagereply.h')
-rw-r--r--storage/src/vespa/storageapi/messageapi/storagereply.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/storage/src/vespa/storageapi/messageapi/storagereply.h b/storage/src/vespa/storageapi/messageapi/storagereply.h
new file mode 100644
index 00000000000..9128617096d
--- /dev/null
+++ b/storage/src/vespa/storageapi/messageapi/storagereply.h
@@ -0,0 +1,39 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+/**
+ * @class storage::api::StorageReply
+ * @ingroup messageapi
+ *
+ * @brief Superclass for all storage replies.
+ *
+ * A storage reply is a storage message sent in reply to a storage command.
+ *
+ * @version $Id$
+ */
+
+#pragma once
+
+#include "returncode.h"
+#include "storagemessage.h"
+
+namespace storage::api {
+
+class StorageCommand;
+
+class StorageReply : public StorageMessage {
+ ReturnCode _result;
+
+protected:
+ explicit StorageReply(const StorageCommand& cmd);
+ StorageReply(const StorageCommand& cmd, ReturnCode code);
+
+public:
+ ~StorageReply() override;
+ DECLARE_POINTER_TYPEDEFS(StorageReply);
+
+ void setResult(ReturnCode r) { _result = std::move(r); }
+ void setResult(ReturnCode::Result r) { _result = ReturnCode(r); }
+ const ReturnCode& getResult() const { return _result; }
+ void print(std::ostream& out, bool verbose, const std::string& indent) const override;
+};
+
+}