diff options
Diffstat (limited to 'src/mongo/rpc/command_reply_builder.h')
-rw-r--r-- | src/mongo/rpc/command_reply_builder.h | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/src/mongo/rpc/command_reply_builder.h b/src/mongo/rpc/command_reply_builder.h index 55292eb6da4..2433a283e04 100644 --- a/src/mongo/rpc/command_reply_builder.h +++ b/src/mongo/rpc/command_reply_builder.h @@ -40,51 +40,50 @@ namespace mongo { namespace rpc { +/** + * Constructs an OP_COMMANDREPLY message. + */ +class CommandReplyBuilder : public ReplyBuilderInterface { +public: /** - * Constructs an OP_COMMANDREPLY message. + * Constructs an OP_COMMANDREPLY in a new buffer. */ - class CommandReplyBuilder : public ReplyBuilderInterface { - public: - - /** - * Constructs an OP_COMMANDREPLY in a new buffer. - */ - CommandReplyBuilder(); + CommandReplyBuilder(); - /* - * Constructs an OP_COMMANDREPLY in an existing buffer. Ownership of the buffer - * will be transfered to the CommandReplyBuilder. - */ - CommandReplyBuilder(std::unique_ptr<Message> message); + /* + * Constructs an OP_COMMANDREPLY in an existing buffer. Ownership of the buffer + * will be transfered to the CommandReplyBuilder. + */ + CommandReplyBuilder(std::unique_ptr<Message> message); - CommandReplyBuilder& setMetadata(BSONObj metadata) final; - CommandReplyBuilder& setRawCommandReply(BSONObj commandReply) final; + CommandReplyBuilder& setMetadata(BSONObj metadata) final; + CommandReplyBuilder& setRawCommandReply(BSONObj commandReply) final; - CommandReplyBuilder& addOutputDocs(DocumentRange outputDocs) final; - CommandReplyBuilder& addOutputDoc(BSONObj outputDoc) final; + CommandReplyBuilder& addOutputDocs(DocumentRange outputDocs) final; + CommandReplyBuilder& addOutputDoc(BSONObj outputDoc) final; - State getState() const final; + State getState() const final; - Protocol getProtocol() const final; + Protocol getProtocol() const final; - void reset() final; + void reset() final; - /** - * Writes data then transfers ownership of the message to the caller. - * The behavior of calling any methods on the object is subsequently - * undefined. - */ - std::unique_ptr<Message> done() final; + /** + * Writes data then transfers ownership of the message to the caller. + * The behavior of calling any methods on the object is subsequently + * undefined. + */ + std::unique_ptr<Message> done() final; - std::size_t availableSpaceForOutputDocs() const final; + std::size_t availableSpaceForOutputDocs() const final; - private: - // Default values are all empty. - BufBuilder _builder{}; - std::unique_ptr<Message> _message; +private: + // Default values are all empty. + BufBuilder _builder{}; + std::unique_ptr<Message> _message; - State _state{State::kMetadata}; - }; + State _state{State::kMetadata}; +}; } // namespace rpc } // namespace mongo |