THRIFT-922. cpp: Templatize binary and compact protocol
Convert TBinaryProtocol and TCompactProtocol to template classes, taking
the transport class as a template parameter. This allows them to make
non-virtual calls when using the template, improving serialization
performance.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005136 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/protocol/TDebugProtocol.h b/lib/cpp/src/protocol/TDebugProtocol.h
index 1efcbd0..3f7877c 100644
--- a/lib/cpp/src/protocol/TDebugProtocol.h
+++ b/lib/cpp/src/protocol/TDebugProtocol.h
@@ -59,6 +59,7 @@
public:
TDebugProtocol(boost::shared_ptr<TTransport> trans)
: TVirtualProtocol<TDebugProtocol>(trans)
+ , trans_(trans.get())
, string_limit_(DEFAULT_STRING_LIMIT)
, string_prefix_size_(DEFAULT_STRING_PREFIX_SIZE)
{
@@ -140,6 +141,8 @@
static std::string fieldTypeName(TType type);
+ TTransport* trans_;
+
int32_t string_limit_;
int32_t string_prefix_size_;