MCPcopy Create free account
hub / github.com/apache/brpc / GetProtobufByteSize

Function GetProtobufByteSize

src/brpc/protocol.h:63–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61// use template to avoid include `google/protobuf/message.h`
62template<typename T>
63inline 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

Callers 6

SerializeRedisRequestFunction · 0.85
PackStreamMessageFunction · 0.85
PackPublicPbrpcRequestFunction · 0.85

Calls 2

ByteSizeLongMethod · 0.45
ByteSizeMethod · 0.45

Tested by

no test coverage detected