MCPcopy Create free account
hub / github.com/apache/thrift / resetProtocol

Method resetProtocol

lib/cpp/src/thrift/protocol/THeaderProtocol.cpp:35–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace protocol {
34
35void THeaderProtocol::resetProtocol() {
36 if (proto_ && protoId_ == trans_->getProtocolId()) {
37 return;
38 }
39
40 protoId_ = trans_->getProtocolId();
41
42 switch (protoId_) {
43 case T_BINARY_PROTOCOL:
44 proto_ = std::make_shared<TBinaryProtocolT<THeaderTransport> >(trans_);
45 break;
46
47 case T_COMPACT_PROTOCOL:
48 proto_ = std::make_shared<TCompactProtocolT<THeaderTransport> >(trans_);
49 break;
50
51 default:
52 throw TApplicationException(TApplicationException::INVALID_PROTOCOL,
53 "Unknown protocol requested");
54 }
55}
56
57uint32_t THeaderProtocol::writeMessageBegin(const std::string& name,
58 const TMessageType messageType,

Callers 1

readMessageBeginMethod · 0.45

Calls 2

getProtocolIdMethod · 0.80

Tested by

no test coverage detected