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/test/Benchmark.cpp b/lib/cpp/test/Benchmark.cpp
index 4a0eae9..a9859d8 100644
--- a/lib/cpp/test/Benchmark.cpp
+++ b/lib/cpp/test/Benchmark.cpp
@@ -19,12 +19,10 @@
 
 #include <iostream>
 #include <cmath>
-#include <transport/TBufferTransports.h>
-#include <protocol/TBinaryProtocol.h>
-#include <protocol/TJSONProtocol.h>
+#include "transport/TBufferTransports.h"
+#include "protocol/TBinaryProtocol.h"
 #include "gen-cpp/DebugProtoTest_types.h"
 #include <time.h>
-#include <protocol/TDebugProtocol.h>
 #include <sys/time.h>
 
 class Timer {
@@ -76,7 +74,7 @@
 
     for (int i = 0; i < num; i ++) {
       buf->resetBuffer();
-      TBinaryProtocol prot(buf);
+      TBinaryProtocolT<TBufferBase> prot(buf);
       ooe.write(&prot);
     }
     cout << "Write: " << num / (1000 * timer.frame()) << " kHz" << endl;
@@ -95,7 +93,7 @@
       OneOfEach ooe2;
       shared_ptr<TMemoryBuffer> buf2(new TMemoryBuffer(data, datasize));
       //buf2->resetBuffer(data, datasize);
-      TBinaryProtocol prot(buf2);
+      TBinaryProtocolT<TBufferBase> prot(buf2);
       ooe2.read(&prot);
 
       //cout << apache::thrift::ThriftDebugString(ooe2) << endl << endl;