diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 00:22:50 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 10:56:02 -0400 |
commit | 9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch) | |
tree | 3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/rpc/legacy_reply.cpp | |
parent | 01965cf52bce6976637ecb8f4a622aeb05ab256a (diff) | |
download | mongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz |
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/rpc/legacy_reply.cpp')
-rw-r--r-- | src/mongo/rpc/legacy_reply.cpp | 90 |
1 files changed, 44 insertions, 46 deletions
diff --git a/src/mongo/rpc/legacy_reply.cpp b/src/mongo/rpc/legacy_reply.cpp index 3c16df28426..62a45ea1286 100644 --- a/src/mongo/rpc/legacy_reply.cpp +++ b/src/mongo/rpc/legacy_reply.cpp @@ -40,52 +40,50 @@ namespace mongo { namespace rpc { - LegacyReply::LegacyReply(const Message* message) - : _message(std::move(message)) { - invariant(message->operation() == opReply); - - QueryResult::View qr = _message->singleData().view2ptr(); - - // should be checked by caller. - invariant(qr.msgdata().getOperation() == opReply); - - uassert(ErrorCodes::BadValue, - str::stream() << "Got legacy command reply with a bad cursorId field," - << " expected a value of 0 but got " << qr.getCursorId(), - qr.getCursorId() == 0); - - uassert(ErrorCodes::BadValue, - str::stream() << "Got legacy command reply with a bad nReturned field," - << " expected a value of 1 but got " << qr.getNReturned(), - qr.getNReturned() == 1); - - uassert(ErrorCodes::BadValue, - str::stream() << "Got legacy command reply with a bad startingFrom field," - << " expected a value of 0 but got " << qr.getStartingFrom(), - qr.getStartingFrom() == 0); - - // TODO bson validation - std::tie(_commandReply, _metadata) = uassertStatusOK( - rpc::upconvertReplyMetadata(BSONObj(qr.data())) - ); - } - - const BSONObj& LegacyReply::getMetadata() const { - return _metadata; - } - - const BSONObj& LegacyReply::getCommandReply() const { - return _commandReply; - } - - DocumentRange LegacyReply::getOutputDocs() const { - // return empty range - return DocumentRange{}; - } - - Protocol LegacyReply::getProtocol() const { - return rpc::Protocol::kOpQuery; - } +LegacyReply::LegacyReply(const Message* message) : _message(std::move(message)) { + invariant(message->operation() == opReply); + + QueryResult::View qr = _message->singleData().view2ptr(); + + // should be checked by caller. + invariant(qr.msgdata().getOperation() == opReply); + + uassert(ErrorCodes::BadValue, + str::stream() << "Got legacy command reply with a bad cursorId field," + << " expected a value of 0 but got " << qr.getCursorId(), + qr.getCursorId() == 0); + + uassert(ErrorCodes::BadValue, + str::stream() << "Got legacy command reply with a bad nReturned field," + << " expected a value of 1 but got " << qr.getNReturned(), + qr.getNReturned() == 1); + + uassert(ErrorCodes::BadValue, + str::stream() << "Got legacy command reply with a bad startingFrom field," + << " expected a value of 0 but got " << qr.getStartingFrom(), + qr.getStartingFrom() == 0); + + // TODO bson validation + std::tie(_commandReply, _metadata) = + uassertStatusOK(rpc::upconvertReplyMetadata(BSONObj(qr.data()))); +} + +const BSONObj& LegacyReply::getMetadata() const { + return _metadata; +} + +const BSONObj& LegacyReply::getCommandReply() const { + return _commandReply; +} + +DocumentRange LegacyReply::getOutputDocs() const { + // return empty range + return DocumentRange{}; +} + +Protocol LegacyReply::getProtocol() const { + return rpc::Protocol::kOpQuery; +} } // namespace rpc } // namespace mongo |