summaryrefslogtreecommitdiff
path: root/src/mongo/rpc/reply_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/rpc/reply_interface.h')
-rw-r--r--src/mongo/rpc/reply_interface.h75
1 files changed, 38 insertions, 37 deletions
diff --git a/src/mongo/rpc/reply_interface.h b/src/mongo/rpc/reply_interface.h
index ac0514dc64f..7786c57cb26 100644
--- a/src/mongo/rpc/reply_interface.h
+++ b/src/mongo/rpc/reply_interface.h
@@ -32,52 +32,53 @@
#include "mongo/rpc/protocol.h"
namespace mongo {
- class BSONObj;
- class Message;
+class BSONObj;
+class Message;
namespace rpc {
- class DocumentRange;
+class DocumentRange;
+
+/**
+ * An immutable view of an RPC Reply.
+ */
+class ReplyInterface {
+ MONGO_DISALLOW_COPYING(ReplyInterface);
+
+public:
+ virtual ~ReplyInterface() = default;
/**
- * An immutable view of an RPC Reply.
+ * Accessor for the metadata object. Metadata is generally used for information
+ * that is independent of any specific command, e.g. auditing information.
*/
- class ReplyInterface {
- MONGO_DISALLOW_COPYING(ReplyInterface);
- public:
- virtual ~ReplyInterface() = default;
-
- /**
- * Accessor for the metadata object. Metadata is generally used for information
- * that is independent of any specific command, e.g. auditing information.
- */
- virtual const BSONObj& getMetadata() const = 0;
+ virtual const BSONObj& getMetadata() const = 0;
- /**
- * The result of executing the command.
- */
- virtual const BSONObj& getCommandReply() const = 0;
+ /**
+ * The result of executing the command.
+ */
+ virtual const BSONObj& getCommandReply() const = 0;
- /**
- * A variable number of BSON documents returned by the command. It is valid for the
- * returned range to be empty.
- *
- * Example usage:
- *
- * for (auto&& doc : reply.getOutputDocs()) {
- * ... do stuff with doc
- * }
- */
- virtual DocumentRange getOutputDocs() const = 0;
+ /**
+ * A variable number of BSON documents returned by the command. It is valid for the
+ * returned range to be empty.
+ *
+ * Example usage:
+ *
+ * for (auto&& doc : reply.getOutputDocs()) {
+ * ... do stuff with doc
+ * }
+ */
+ virtual DocumentRange getOutputDocs() const = 0;
- /**
- * Gets the protocol used to deserialize this reply. This should be used for validity
- * checks only - runtime behavior changes should be implemented with polymorphism.
- */
- virtual Protocol getProtocol() const = 0;
+ /**
+ * Gets the protocol used to deserialize this reply. This should be used for validity
+ * checks only - runtime behavior changes should be implemented with polymorphism.
+ */
+ virtual Protocol getProtocol() const = 0;
- protected:
- ReplyInterface() = default;
- };
+protected:
+ ReplyInterface() = default;
+};
} // namespace rpc
} // namespace mongo