| 61 | // use template to avoid include `google/protobuf/message.h` |
| 62 | template<typename T> |
| 63 | inline uint32_t GetProtobufByteSize(const T& message) { |
| 64 | #if GOOGLE_PROTOBUF_VERSION >= 3010000 |
| 65 | return message.ByteSizeLong(); |
| 66 | #else |
| 67 | return static_cast<uint32_t>(message.ByteSize()); |
| 68 | #endif |
| 69 | } |
| 70 | |
| 71 | // 3 steps to add a new Protocol: |
| 72 | // Step1: Add a new ProtocolType in src/brpc/options.proto |
no test coverage detected