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/protocol.h | |
parent | 01965cf52bce6976637ecb8f4a622aeb05ab256a (diff) | |
download | mongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz |
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/rpc/protocol.h')
-rw-r--r-- | src/mongo/rpc/protocol.h | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/src/mongo/rpc/protocol.h b/src/mongo/rpc/protocol.h index bb77caf5e85..99e6cacc92c 100644 --- a/src/mongo/rpc/protocol.h +++ b/src/mongo/rpc/protocol.h @@ -37,63 +37,63 @@ namespace mongo { namespace rpc { +/** + * Bit flags representing support for a particular RPC protocol. + * This is just an internal representation, and is never transmitted over the wire. It should + * never be used for any other feature detection in favor of max/min wire version. + * + * A new protocol must be added as the highest order bit flag so that it is prioritized in + * negotiation. + */ +enum class Protocol : std::uint64_t { + /** - * Bit flags representing support for a particular RPC protocol. - * This is just an internal representation, and is never transmitted over the wire. It should - * never be used for any other feature detection in favor of max/min wire version. - * - * A new protocol must be added as the highest order bit flag so that it is prioritized in - * negotiation. + * The pre-3.2 OP_QUERY on db.$cmd protocol */ - enum class Protocol : std::uint64_t { - - /** - * The pre-3.2 OP_QUERY on db.$cmd protocol - */ - kOpQuery = 1 << 0, - - /** - * The post-3.2 OP_COMMAND protocol. - */ - kOpCommandV1 = 1 << 1, - }; + kOpQuery = 1 << 0, /** - * Bitfield representing a set of supported RPC protocols. + * The post-3.2 OP_COMMAND protocol. */ - using ProtocolSet = std::underlying_type<Protocol>::type; + kOpCommandV1 = 1 << 1, +}; + +/** + * Bitfield representing a set of supported RPC protocols. + */ +using ProtocolSet = std::underlying_type<Protocol>::type; /** * This namespace contains predefined bitfields for common levels of protocol support. */ namespace supports { - const ProtocolSet kNone = ProtocolSet{0}; - const ProtocolSet kOpQueryOnly = static_cast<ProtocolSet>(Protocol::kOpQuery); - const ProtocolSet kOpCommandOnly = static_cast<ProtocolSet>(Protocol::kOpCommandV1); - const ProtocolSet kAll = kOpQueryOnly | kOpCommandOnly; +const ProtocolSet kNone = ProtocolSet{0}; +const ProtocolSet kOpQueryOnly = static_cast<ProtocolSet>(Protocol::kOpQuery); +const ProtocolSet kOpCommandOnly = static_cast<ProtocolSet>(Protocol::kOpCommandV1); +const ProtocolSet kAll = kOpQueryOnly | kOpCommandOnly; } // namespace supports - /** - * Returns the newest protocol supported by two parties. - */ - StatusWith<Protocol> negotiate(ProtocolSet fst, ProtocolSet snd); +/** + * Returns the newest protocol supported by two parties. + */ +StatusWith<Protocol> negotiate(ProtocolSet fst, ProtocolSet snd); - /** - * Converts a ProtocolSet to a string. Currently only the predefined ProtocolSets in the - * 'supports' namespace are supported. - * - * This intentionally does not conform to the STL 'to_string' convention so that it will - * not conflict with the to_string overload for uint64_t. - */ - StatusWith<StringData> toString(ProtocolSet protocols); +/** + * Converts a ProtocolSet to a string. Currently only the predefined ProtocolSets in the + * 'supports' namespace are supported. + * + * This intentionally does not conform to the STL 'to_string' convention so that it will + * not conflict with the to_string overload for uint64_t. + */ +StatusWith<StringData> toString(ProtocolSet protocols); - /** - * Parses a ProtocolSet from a string. Currently only the predefined ProtocolSets in the - * 'supports' namespace are supported - */ - StatusWith<ProtocolSet> parseProtocolSet(StringData repr); +/** + * Parses a ProtocolSet from a string. Currently only the predefined ProtocolSets in the + * 'supports' namespace are supported + */ +StatusWith<ProtocolSet> parseProtocolSet(StringData repr); } // namespace rpc } // namespace mongo |