THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/'

To ensure there are no include path collisions the C and C++ header
include paths should include 'thrift' as the root leaf. This will
prevent having to place /usr/include/thrift into the compilers include
header search path, which might otherwise result in the compiler
accidentally picking up headers that it shouldn't.

e.g. #include <foo/bar.h> should be #include <thrift/foo/bar.h>

Change-Id: I48f2b0f549bda0fc81e85506ac857adc800b98a1

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1325674 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/TApplicationException.cpp b/lib/cpp/src/thrift/TApplicationException.cpp
similarity index 96%
rename from lib/cpp/src/TApplicationException.cpp
rename to lib/cpp/src/thrift/TApplicationException.cpp
index 32238fb..1110ba2 100644
--- a/lib/cpp/src/TApplicationException.cpp
+++ b/lib/cpp/src/thrift/TApplicationException.cpp
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-#include <TApplicationException.h>
-#include <protocol/TProtocol.h>
+#include <thrift/TApplicationException.h>
+#include <thrift/protocol/TProtocol.h>
 
 namespace apache { namespace thrift {
 
diff --git a/lib/cpp/src/TApplicationException.h b/lib/cpp/src/thrift/TApplicationException.h
similarity index 98%
rename from lib/cpp/src/TApplicationException.h
rename to lib/cpp/src/thrift/TApplicationException.h
index 61e6864..79f026d 100644
--- a/lib/cpp/src/TApplicationException.h
+++ b/lib/cpp/src/thrift/TApplicationException.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_TAPPLICATIONEXCEPTION_H_
 #define _THRIFT_TAPPLICATIONEXCEPTION_H_ 1
 
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 
 
 namespace apache { namespace thrift {
diff --git a/lib/cpp/src/TDispatchProcessor.h b/lib/cpp/src/thrift/TDispatchProcessor.h
similarity index 100%
rename from lib/cpp/src/TDispatchProcessor.h
rename to lib/cpp/src/thrift/TDispatchProcessor.h
diff --git a/lib/cpp/src/TLogging.h b/lib/cpp/src/thrift/TLogging.h
similarity index 100%
rename from lib/cpp/src/TLogging.h
rename to lib/cpp/src/thrift/TLogging.h
diff --git a/lib/cpp/src/TProcessor.h b/lib/cpp/src/thrift/TProcessor.h
similarity index 99%
rename from lib/cpp/src/TProcessor.h
rename to lib/cpp/src/thrift/TProcessor.h
index 26c3ee4..b4a4657 100644
--- a/lib/cpp/src/TProcessor.h
+++ b/lib/cpp/src/thrift/TProcessor.h
@@ -21,7 +21,7 @@
 #define _THRIFT_TPROCESSOR_H_ 1
 
 #include <string>
-#include <protocol/TProtocol.h>
+#include <thrift/protocol/TProtocol.h>
 #include <boost/shared_ptr.hpp>
 
 namespace apache { namespace thrift {
diff --git a/lib/cpp/src/TReflectionLocal.h b/lib/cpp/src/thrift/TReflectionLocal.h
similarity index 98%
rename from lib/cpp/src/TReflectionLocal.h
rename to lib/cpp/src/thrift/TReflectionLocal.h
index e83e475..2ef7511 100644
--- a/lib/cpp/src/TReflectionLocal.h
+++ b/lib/cpp/src/thrift/TReflectionLocal.h
@@ -22,7 +22,7 @@
 
 #include <stdint.h>
 #include <cstring>
-#include <protocol/TProtocol.h>
+#include <thrift/protocol/TProtocol.h>
 
 /**
  * Local Reflection is a blanket term referring to the the structure
diff --git a/lib/cpp/src/Thrift.cpp b/lib/cpp/src/thrift/Thrift.cpp
similarity index 98%
rename from lib/cpp/src/Thrift.cpp
rename to lib/cpp/src/thrift/Thrift.cpp
index 114947f..bcbdb1a 100644
--- a/lib/cpp/src/Thrift.cpp
+++ b/lib/cpp/src/thrift/Thrift.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 #include <cstring>
 #include <cstdlib>
 #include <boost/lexical_cast.hpp>
diff --git a/lib/cpp/src/Thrift.h b/lib/cpp/src/thrift/Thrift.h
similarity index 99%
rename from lib/cpp/src/Thrift.h
rename to lib/cpp/src/thrift/Thrift.h
index 60a66f4..5cdc37e 100644
--- a/lib/cpp/src/Thrift.h
+++ b/lib/cpp/src/thrift/Thrift.h
@@ -21,7 +21,7 @@
 #define _THRIFT_THRIFT_H_ 1
 
 #ifdef _WIN32
-#include "windows/config.h"
+#include <thrift/windows/config.h>
 #endif
 
 #ifdef HAVE_CONFIG_H
diff --git a/lib/cpp/src/VirtualProfiling.cpp b/lib/cpp/src/thrift/VirtualProfiling.cpp
similarity index 99%
rename from lib/cpp/src/VirtualProfiling.cpp
rename to lib/cpp/src/thrift/VirtualProfiling.cpp
index 0b023af..180cfb7 100644
--- a/lib/cpp/src/VirtualProfiling.cpp
+++ b/lib/cpp/src/thrift/VirtualProfiling.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 
 // Do nothing if virtual call profiling is not enabled
 #if T_GLOBAL_DEBUG_VIRTUAL > 1
@@ -36,7 +36,7 @@
 #endif // !__GLIBC__
 
 
-#include <concurrency/Mutex.h>
+#include <thrift/concurrency/Mutex.h>
 
 #include <ext/hash_map>
 #include <execinfo.h>
diff --git a/lib/cpp/src/async/TAsyncBufferProcessor.h b/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h
similarity index 96%
rename from lib/cpp/src/async/TAsyncBufferProcessor.h
rename to lib/cpp/src/thrift/async/TAsyncBufferProcessor.h
index bfaf323..a7f6435 100644
--- a/lib/cpp/src/async/TAsyncBufferProcessor.h
+++ b/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h
@@ -23,7 +23,7 @@
 #include <tr1/functional>
 #include <boost/shared_ptr.hpp>
 
-#include "transport/TBufferTransports.h"
+#include <thrift/transport/TBufferTransports.h>
 
 namespace apache { namespace thrift { namespace async {
 
diff --git a/lib/cpp/src/async/TAsyncChannel.cpp b/lib/cpp/src/thrift/async/TAsyncChannel.cpp
similarity index 96%
rename from lib/cpp/src/async/TAsyncChannel.cpp
rename to lib/cpp/src/thrift/async/TAsyncChannel.cpp
index 9397017..bfde660 100644
--- a/lib/cpp/src/async/TAsyncChannel.cpp
+++ b/lib/cpp/src/thrift/async/TAsyncChannel.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <async/TAsyncChannel.h>
+#include <thrift/async/TAsyncChannel.h>
 #include <tr1/functional>
 
 namespace apache { namespace thrift { namespace async {
diff --git a/lib/cpp/src/async/TAsyncChannel.h b/lib/cpp/src/thrift/async/TAsyncChannel.h
similarity index 98%
rename from lib/cpp/src/async/TAsyncChannel.h
rename to lib/cpp/src/thrift/async/TAsyncChannel.h
index 856ab31..634b6a4 100644
--- a/lib/cpp/src/async/TAsyncChannel.h
+++ b/lib/cpp/src/thrift/async/TAsyncChannel.h
@@ -21,7 +21,7 @@
 #define _THRIFT_ASYNC_TASYNCCHANNEL_H_ 1
 
 #include <tr1/functional>
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 
 namespace apache { namespace thrift { namespace transport {
 class TMemoryBuffer;
diff --git a/lib/cpp/src/async/TAsyncDispatchProcessor.h b/lib/cpp/src/thrift/async/TAsyncDispatchProcessor.h
similarity index 100%
rename from lib/cpp/src/async/TAsyncDispatchProcessor.h
rename to lib/cpp/src/thrift/async/TAsyncDispatchProcessor.h
diff --git a/lib/cpp/src/async/TAsyncProcessor.h b/lib/cpp/src/thrift/async/TAsyncProcessor.h
similarity index 98%
rename from lib/cpp/src/async/TAsyncProcessor.h
rename to lib/cpp/src/thrift/async/TAsyncProcessor.h
index c62f8b7..593ea69 100644
--- a/lib/cpp/src/async/TAsyncProcessor.h
+++ b/lib/cpp/src/thrift/async/TAsyncProcessor.h
@@ -22,7 +22,7 @@
 
 #include <tr1/functional>
 #include <boost/shared_ptr.hpp>
-#include <protocol/TProtocol.h>
+#include <thrift/protocol/TProtocol.h>
 #include <TProcessor.h>
 
 namespace apache { namespace thrift { namespace async {
diff --git a/lib/cpp/src/async/TAsyncProtocolProcessor.cpp b/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.cpp
similarity index 100%
rename from lib/cpp/src/async/TAsyncProtocolProcessor.cpp
rename to lib/cpp/src/thrift/async/TAsyncProtocolProcessor.cpp
diff --git a/lib/cpp/src/async/TAsyncProtocolProcessor.h b/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h
similarity index 97%
rename from lib/cpp/src/async/TAsyncProtocolProcessor.h
rename to lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h
index 647bbb6..139e394 100644
--- a/lib/cpp/src/async/TAsyncProtocolProcessor.h
+++ b/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h
@@ -22,7 +22,7 @@
 
 #include "TAsyncProcessor.h"
 #include "TAsyncBufferProcessor.h"
-#include "protocol/TProtocol.h"
+#include <thrift/protocol/TProtocol.h>
 
 namespace apache { namespace thrift { namespace async {
 
diff --git a/lib/cpp/src/async/TEvhttpClientChannel.cpp b/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
similarity index 97%
rename from lib/cpp/src/async/TEvhttpClientChannel.cpp
rename to lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
index c0363fc..5871503 100755
--- a/lib/cpp/src/async/TEvhttpClientChannel.cpp
+++ b/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
@@ -19,8 +19,8 @@
 
 #include "TEvhttpClientChannel.h"
 #include <evhttp.h>
-#include "transport/TBufferTransports.h"
-#include <protocol/TProtocolException.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/protocol/TProtocolException.h>
 
 #include <iostream>
 #include <sstream>
diff --git a/lib/cpp/src/async/TEvhttpClientChannel.h b/lib/cpp/src/thrift/async/TEvhttpClientChannel.h
similarity index 100%
rename from lib/cpp/src/async/TEvhttpClientChannel.h
rename to lib/cpp/src/thrift/async/TEvhttpClientChannel.h
diff --git a/lib/cpp/src/async/TEvhttpServer.cpp b/lib/cpp/src/thrift/async/TEvhttpServer.cpp
similarity index 98%
rename from lib/cpp/src/async/TEvhttpServer.cpp
rename to lib/cpp/src/thrift/async/TEvhttpServer.cpp
index b92422c..73516db 100755
--- a/lib/cpp/src/async/TEvhttpServer.cpp
+++ b/lib/cpp/src/thrift/async/TEvhttpServer.cpp
@@ -19,7 +19,7 @@
 
 #include "TEvhttpServer.h"
 #include "TAsyncBufferProcessor.h"
-#include "transport/TBufferTransports.h"
+#include <thrift/transport/TBufferTransports.h>
 #include <evhttp.h>
 
 #include <iostream>
diff --git a/lib/cpp/src/async/TEvhttpServer.h b/lib/cpp/src/thrift/async/TEvhttpServer.h
similarity index 100%
rename from lib/cpp/src/async/TEvhttpServer.h
rename to lib/cpp/src/thrift/async/TEvhttpServer.h
diff --git a/lib/cpp/src/concurrency/BoostMonitor.cpp b/lib/cpp/src/thrift/concurrency/BoostMonitor.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/BoostMonitor.cpp
rename to lib/cpp/src/thrift/concurrency/BoostMonitor.cpp
diff --git a/lib/cpp/src/concurrency/BoostMutex.cpp b/lib/cpp/src/thrift/concurrency/BoostMutex.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/BoostMutex.cpp
rename to lib/cpp/src/thrift/concurrency/BoostMutex.cpp
diff --git a/lib/cpp/src/concurrency/BoostThreadFactory.cpp b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/BoostThreadFactory.cpp
rename to lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
diff --git a/lib/cpp/src/concurrency/BoostThreadFactory.h b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.h
similarity index 100%
rename from lib/cpp/src/concurrency/BoostThreadFactory.h
rename to lib/cpp/src/thrift/concurrency/BoostThreadFactory.h
diff --git a/lib/cpp/src/concurrency/Exception.h b/lib/cpp/src/thrift/concurrency/Exception.h
similarity index 98%
rename from lib/cpp/src/concurrency/Exception.h
rename to lib/cpp/src/thrift/concurrency/Exception.h
index 06ba0d3..c62f116 100644
--- a/lib/cpp/src/concurrency/Exception.h
+++ b/lib/cpp/src/thrift/concurrency/Exception.h
@@ -21,7 +21,7 @@
 #define _THRIFT_CONCURRENCY_EXCEPTION_H_ 1
 
 #include <exception>
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 
 namespace apache { namespace thrift { namespace concurrency {
 
diff --git a/lib/cpp/src/concurrency/FunctionRunner.h b/lib/cpp/src/thrift/concurrency/FunctionRunner.h
similarity index 100%
rename from lib/cpp/src/concurrency/FunctionRunner.h
rename to lib/cpp/src/thrift/concurrency/FunctionRunner.h
diff --git a/lib/cpp/src/concurrency/Monitor.cpp b/lib/cpp/src/thrift/concurrency/Monitor.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/Monitor.cpp
rename to lib/cpp/src/thrift/concurrency/Monitor.cpp
diff --git a/lib/cpp/src/concurrency/Monitor.h b/lib/cpp/src/thrift/concurrency/Monitor.h
similarity index 100%
rename from lib/cpp/src/concurrency/Monitor.h
rename to lib/cpp/src/thrift/concurrency/Monitor.h
diff --git a/lib/cpp/src/concurrency/Mutex.cpp b/lib/cpp/src/thrift/concurrency/Mutex.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/Mutex.cpp
rename to lib/cpp/src/thrift/concurrency/Mutex.cpp
diff --git a/lib/cpp/src/concurrency/Mutex.h b/lib/cpp/src/thrift/concurrency/Mutex.h
similarity index 100%
rename from lib/cpp/src/concurrency/Mutex.h
rename to lib/cpp/src/thrift/concurrency/Mutex.h
diff --git a/lib/cpp/src/concurrency/PlatformThreadFactory.h b/lib/cpp/src/thrift/concurrency/PlatformThreadFactory.h
similarity index 91%
rename from lib/cpp/src/concurrency/PlatformThreadFactory.h
rename to lib/cpp/src/thrift/concurrency/PlatformThreadFactory.h
index 04fdc5b..04f6ee3 100644
--- a/lib/cpp/src/concurrency/PlatformThreadFactory.h
+++ b/lib/cpp/src/thrift/concurrency/PlatformThreadFactory.h
@@ -21,9 +21,9 @@
 #define _THRIFT_CONCURRENCY_PLATFORMTHREADFACTORY_H_ 1
 
 #ifndef USE_BOOST_THREAD
-#  include <concurrency/PosixThreadFactory.h>
+#  include <thrift/concurrency/PosixThreadFactory.h>
 #else
-#  include <concurrency/BoostThreadFactory.h>
+#  include <thrift/concurrency/BoostThreadFactory.h>
 #endif
 
 namespace apache { namespace thrift { namespace concurrency {
diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.cpp b/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/PosixThreadFactory.cpp
rename to lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.h b/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
similarity index 100%
rename from lib/cpp/src/concurrency/PosixThreadFactory.h
rename to lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
diff --git a/lib/cpp/src/concurrency/Thread.h b/lib/cpp/src/thrift/concurrency/Thread.h
similarity index 100%
rename from lib/cpp/src/concurrency/Thread.h
rename to lib/cpp/src/thrift/concurrency/Thread.h
diff --git a/lib/cpp/src/concurrency/ThreadManager.cpp b/lib/cpp/src/thrift/concurrency/ThreadManager.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/ThreadManager.cpp
rename to lib/cpp/src/thrift/concurrency/ThreadManager.cpp
diff --git a/lib/cpp/src/concurrency/ThreadManager.h b/lib/cpp/src/thrift/concurrency/ThreadManager.h
similarity index 100%
rename from lib/cpp/src/concurrency/ThreadManager.h
rename to lib/cpp/src/thrift/concurrency/ThreadManager.h
diff --git a/lib/cpp/src/concurrency/TimerManager.cpp b/lib/cpp/src/thrift/concurrency/TimerManager.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/TimerManager.cpp
rename to lib/cpp/src/thrift/concurrency/TimerManager.cpp
diff --git a/lib/cpp/src/concurrency/TimerManager.h b/lib/cpp/src/thrift/concurrency/TimerManager.h
similarity index 100%
rename from lib/cpp/src/concurrency/TimerManager.h
rename to lib/cpp/src/thrift/concurrency/TimerManager.h
diff --git a/lib/cpp/src/concurrency/Util.cpp b/lib/cpp/src/thrift/concurrency/Util.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/Util.cpp
rename to lib/cpp/src/thrift/concurrency/Util.cpp
diff --git a/lib/cpp/src/concurrency/Util.h b/lib/cpp/src/thrift/concurrency/Util.h
similarity index 100%
rename from lib/cpp/src/concurrency/Util.h
rename to lib/cpp/src/thrift/concurrency/Util.h
diff --git a/lib/cpp/src/concurrency/test/Tests.cpp b/lib/cpp/src/thrift/concurrency/test/Tests.cpp
similarity index 100%
rename from lib/cpp/src/concurrency/test/Tests.cpp
rename to lib/cpp/src/thrift/concurrency/test/Tests.cpp
diff --git a/lib/cpp/src/concurrency/test/ThreadFactoryTests.h b/lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h
similarity index 97%
rename from lib/cpp/src/concurrency/test/ThreadFactoryTests.h
rename to lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h
index d9066b5..b7e873f 100644
--- a/lib/cpp/src/concurrency/test/ThreadFactoryTests.h
+++ b/lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h
@@ -18,10 +18,10 @@
  */
 
 #include <config.h>
-#include <concurrency/Thread.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/Util.h>
+#include <thrift/concurrency/Thread.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/Util.h>
 
 #include <assert.h>
 #include <unistd.h>
diff --git a/lib/cpp/src/concurrency/test/ThreadManagerTests.h b/lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h
similarity index 97%
rename from lib/cpp/src/concurrency/test/ThreadManagerTests.h
rename to lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h
index e12201c..b734f7a 100644
--- a/lib/cpp/src/concurrency/test/ThreadManagerTests.h
+++ b/lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h
@@ -18,10 +18,10 @@
  */
 
 #include <config.h>
-#include <concurrency/ThreadManager.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/Util.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/Util.h>
 
 #include <assert.h>
 #include <set>
diff --git a/lib/cpp/src/concurrency/test/TimerManagerTests.h b/lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h
similarity index 95%
rename from lib/cpp/src/concurrency/test/TimerManagerTests.h
rename to lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h
index 41f1674..4fe9667 100644
--- a/lib/cpp/src/concurrency/test/TimerManagerTests.h
+++ b/lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h
@@ -17,10 +17,10 @@
  * under the License.
  */
 
-#include <concurrency/TimerManager.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/Util.h>
+#include <thrift/concurrency/TimerManager.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/Util.h>
 
 #include <assert.h>
 #include <iostream>
diff --git a/lib/cpp/src/processor/PeekProcessor.cpp b/lib/cpp/src/thrift/processor/PeekProcessor.cpp
similarity index 100%
rename from lib/cpp/src/processor/PeekProcessor.cpp
rename to lib/cpp/src/thrift/processor/PeekProcessor.cpp
diff --git a/lib/cpp/src/processor/PeekProcessor.h b/lib/cpp/src/thrift/processor/PeekProcessor.h
similarity index 95%
rename from lib/cpp/src/processor/PeekProcessor.h
rename to lib/cpp/src/thrift/processor/PeekProcessor.h
index cb703f6..60e1559 100644
--- a/lib/cpp/src/processor/PeekProcessor.h
+++ b/lib/cpp/src/thrift/processor/PeekProcessor.h
@@ -22,9 +22,9 @@
 
 #include <string>
 #include <TProcessor.h>
-#include <transport/TTransport.h>
-#include <transport/TTransportUtils.h>
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/transport/TTransportUtils.h>
+#include <thrift/transport/TBufferTransports.h>
 #include <boost/shared_ptr.hpp>
 
 namespace apache { namespace thrift { namespace processor {
diff --git a/lib/cpp/src/processor/StatsProcessor.h b/lib/cpp/src/thrift/processor/StatsProcessor.h
similarity index 98%
rename from lib/cpp/src/processor/StatsProcessor.h
rename to lib/cpp/src/thrift/processor/StatsProcessor.h
index 8600c6b..58cd1dc 100644
--- a/lib/cpp/src/processor/StatsProcessor.h
+++ b/lib/cpp/src/thrift/processor/StatsProcessor.h
@@ -21,8 +21,8 @@
 #define STATSPROCESSOR_H
 
 #include <boost/shared_ptr.hpp>
-#include <transport/TTransport.h>
-#include <protocol/TProtocol.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/protocol/TProtocol.h>
 #include <TProcessor.h>
 
 namespace apache { namespace thrift { namespace processor {
diff --git a/lib/cpp/src/protocol/TBase64Utils.cpp b/lib/cpp/src/thrift/protocol/TBase64Utils.cpp
similarity index 100%
rename from lib/cpp/src/protocol/TBase64Utils.cpp
rename to lib/cpp/src/thrift/protocol/TBase64Utils.cpp
diff --git a/lib/cpp/src/protocol/TBase64Utils.h b/lib/cpp/src/thrift/protocol/TBase64Utils.h
similarity index 100%
rename from lib/cpp/src/protocol/TBase64Utils.h
rename to lib/cpp/src/thrift/protocol/TBase64Utils.h
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.h b/lib/cpp/src/thrift/protocol/TBinaryProtocol.h
similarity index 100%
rename from lib/cpp/src/protocol/TBinaryProtocol.h
rename to lib/cpp/src/thrift/protocol/TBinaryProtocol.h
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.tcc b/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc
similarity index 100%
rename from lib/cpp/src/protocol/TBinaryProtocol.tcc
rename to lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc
diff --git a/lib/cpp/src/protocol/TCompactProtocol.h b/lib/cpp/src/thrift/protocol/TCompactProtocol.h
similarity index 100%
rename from lib/cpp/src/protocol/TCompactProtocol.h
rename to lib/cpp/src/thrift/protocol/TCompactProtocol.h
diff --git a/lib/cpp/src/protocol/TCompactProtocol.tcc b/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc
similarity index 100%
rename from lib/cpp/src/protocol/TCompactProtocol.tcc
rename to lib/cpp/src/thrift/protocol/TCompactProtocol.tcc
diff --git a/lib/cpp/src/protocol/TDebugProtocol.cpp b/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp
similarity index 100%
rename from lib/cpp/src/protocol/TDebugProtocol.cpp
rename to lib/cpp/src/thrift/protocol/TDebugProtocol.cpp
diff --git a/lib/cpp/src/protocol/TDebugProtocol.h b/lib/cpp/src/thrift/protocol/TDebugProtocol.h
similarity index 98%
rename from lib/cpp/src/protocol/TDebugProtocol.h
rename to lib/cpp/src/thrift/protocol/TDebugProtocol.h
index 3f7877c..f64928e 100644
--- a/lib/cpp/src/protocol/TDebugProtocol.h
+++ b/lib/cpp/src/thrift/protocol/TDebugProtocol.h
@@ -171,7 +171,7 @@
 
 
 // TODO(dreiss): Move (part of) ThriftDebugString into a .cpp file and remove this.
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 
 namespace apache { namespace thrift {
 
diff --git a/lib/cpp/src/protocol/TDenseProtocol.cpp b/lib/cpp/src/thrift/protocol/TDenseProtocol.cpp
similarity index 100%
rename from lib/cpp/src/protocol/TDenseProtocol.cpp
rename to lib/cpp/src/thrift/protocol/TDenseProtocol.cpp
diff --git a/lib/cpp/src/protocol/TDenseProtocol.h b/lib/cpp/src/thrift/protocol/TDenseProtocol.h
similarity index 100%
rename from lib/cpp/src/protocol/TDenseProtocol.h
rename to lib/cpp/src/thrift/protocol/TDenseProtocol.h
diff --git a/lib/cpp/src/protocol/TJSONProtocol.cpp b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
similarity index 99%
rename from lib/cpp/src/protocol/TJSONProtocol.cpp
rename to lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
index d038df4..6f1612e 100644
--- a/lib/cpp/src/protocol/TJSONProtocol.cpp
+++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
@@ -22,7 +22,7 @@
 #include <math.h>
 #include <boost/lexical_cast.hpp>
 #include "TBase64Utils.h"
-#include <transport/TTransportException.h>
+#include <thrift/transport/TTransportException.h>
 
 using namespace apache::thrift::transport;
 
diff --git a/lib/cpp/src/protocol/TJSONProtocol.h b/lib/cpp/src/thrift/protocol/TJSONProtocol.h
similarity index 99%
rename from lib/cpp/src/protocol/TJSONProtocol.h
rename to lib/cpp/src/thrift/protocol/TJSONProtocol.h
index 799c361..0a6f09c 100644
--- a/lib/cpp/src/protocol/TJSONProtocol.h
+++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.h
@@ -314,7 +314,7 @@
 
 
 // TODO(dreiss): Move part of ThriftJSONString into a .cpp file and remove this.
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 
 namespace apache { namespace thrift {
 
diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/thrift/protocol/TProtocol.h
similarity index 99%
rename from lib/cpp/src/protocol/TProtocol.h
rename to lib/cpp/src/thrift/protocol/TProtocol.h
index dfd5eb5..f6802e6 100644
--- a/lib/cpp/src/protocol/TProtocol.h
+++ b/lib/cpp/src/thrift/protocol/TProtocol.h
@@ -20,8 +20,8 @@
 #ifndef _THRIFT_PROTOCOL_TPROTOCOL_H_
 #define _THRIFT_PROTOCOL_TPROTOCOL_H_ 1
 
-#include <transport/TTransport.h>
-#include <protocol/TProtocolException.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/protocol/TProtocolException.h>
 
 #include <boost/shared_ptr.hpp>
 #include <boost/static_assert.hpp>
diff --git a/lib/cpp/src/protocol/TProtocolException.h b/lib/cpp/src/thrift/protocol/TProtocolException.h
similarity index 100%
rename from lib/cpp/src/protocol/TProtocolException.h
rename to lib/cpp/src/thrift/protocol/TProtocolException.h
diff --git a/lib/cpp/src/protocol/TProtocolTap.h b/lib/cpp/src/thrift/protocol/TProtocolTap.h
similarity index 98%
rename from lib/cpp/src/protocol/TProtocolTap.h
rename to lib/cpp/src/thrift/protocol/TProtocolTap.h
index 3772bff..f493f88 100644
--- a/lib/cpp/src/protocol/TProtocolTap.h
+++ b/lib/cpp/src/thrift/protocol/TProtocolTap.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_PROTOCOL_TPROTOCOLTAP_H_
 #define _THRIFT_PROTOCOL_TPROTOCOLTAP_H_ 1
 
-#include <protocol/TVirtualProtocol.h>
+#include <thrift/protocol/TVirtualProtocol.h>
 
 namespace apache { namespace thrift { namespace protocol {
 
diff --git a/lib/cpp/src/protocol/TVirtualProtocol.h b/lib/cpp/src/thrift/protocol/TVirtualProtocol.h
similarity index 99%
rename from lib/cpp/src/protocol/TVirtualProtocol.h
rename to lib/cpp/src/thrift/protocol/TVirtualProtocol.h
index 6c7f519..e068725 100644
--- a/lib/cpp/src/protocol/TVirtualProtocol.h
+++ b/lib/cpp/src/thrift/protocol/TVirtualProtocol.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_PROTOCOL_TVIRTUALPROTOCOL_H_
 #define _THRIFT_PROTOCOL_TVIRTUALPROTOCOL_H_ 1
 
-#include <protocol/TProtocol.h>
+#include <thrift/protocol/TProtocol.h>
 
 namespace apache { namespace thrift { namespace protocol {
 
diff --git a/lib/cpp/src/qt/TQIODeviceTransport.cpp b/lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp
similarity index 97%
rename from lib/cpp/src/qt/TQIODeviceTransport.cpp
rename to lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp
index c03894e..9344e40 100644
--- a/lib/cpp/src/qt/TQIODeviceTransport.cpp
+++ b/lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp
@@ -19,10 +19,10 @@
 
 #include "TQIODeviceTransport.h"
 
-#include <QAbstractSocket>
+#include <thrift/QAbstractSocket>
 #include <QIODevice>
 
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 
 using boost::shared_ptr;
   
diff --git a/lib/cpp/src/qt/TQIODeviceTransport.h b/lib/cpp/src/thrift/qt/TQIODeviceTransport.h
similarity index 97%
rename from lib/cpp/src/qt/TQIODeviceTransport.h
rename to lib/cpp/src/thrift/qt/TQIODeviceTransport.h
index 3d152f4..64faa12 100644
--- a/lib/cpp/src/qt/TQIODeviceTransport.h
+++ b/lib/cpp/src/thrift/qt/TQIODeviceTransport.h
@@ -22,7 +22,7 @@
 
 #include <boost/shared_ptr.hpp>
 
-#include <transport/TVirtualTransport.h>
+#include <thrift/transport/TVirtualTransport.h>
 
 class QIODevice;
 
diff --git a/lib/cpp/src/qt/TQTcpServer.cpp b/lib/cpp/src/thrift/qt/TQTcpServer.cpp
similarity index 98%
rename from lib/cpp/src/qt/TQTcpServer.cpp
rename to lib/cpp/src/thrift/qt/TQTcpServer.cpp
index f08ec3d..2af8fa3 100644
--- a/lib/cpp/src/qt/TQTcpServer.cpp
+++ b/lib/cpp/src/thrift/qt/TQTcpServer.cpp
@@ -24,8 +24,8 @@
 
 #include <tr1/functional>
 
-#include <protocol/TProtocol.h>
-#include <async/TAsyncProcessor.h>
+#include <thrift/protocol/TProtocol.h>
+#include <thrift/async/TAsyncProcessor.h>
 
 using boost::shared_ptr;
 using apache::thrift::protocol::TProtocol;
diff --git a/lib/cpp/src/qt/TQTcpServer.h b/lib/cpp/src/thrift/qt/TQTcpServer.h
similarity index 100%
rename from lib/cpp/src/qt/TQTcpServer.h
rename to lib/cpp/src/thrift/qt/TQTcpServer.h
diff --git a/lib/cpp/src/server/TNonblockingServer.cpp b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
similarity index 99%
rename from lib/cpp/src/server/TNonblockingServer.cpp
rename to lib/cpp/src/thrift/server/TNonblockingServer.cpp
index bd76cfc..3e95508 100644
--- a/lib/cpp/src/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -24,9 +24,9 @@
 #endif
 
 #include "TNonblockingServer.h"
-#include <concurrency/Exception.h>
-#include <transport/TSocket.h>
-#include <concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Exception.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
 
 #include <iostream>
 
diff --git a/lib/cpp/src/server/TNonblockingServer.h b/lib/cpp/src/thrift/server/TNonblockingServer.h
similarity index 98%
rename from lib/cpp/src/server/TNonblockingServer.h
rename to lib/cpp/src/thrift/server/TNonblockingServer.h
index 6b854b5..e995424 100644
--- a/lib/cpp/src/server/TNonblockingServer.h
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.h
@@ -20,15 +20,15 @@
 #ifndef _THRIFT_SERVER_TNONBLOCKINGSERVER_H_
 #define _THRIFT_SERVER_TNONBLOCKINGSERVER_H_ 1
 
-#include <Thrift.h>
-#include <server/TServer.h>
-#include <transport/TBufferTransports.h>
-#include <transport/TSocket.h>
-#include <concurrency/ThreadManager.h>
+#include <thrift/Thrift.h>
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/transport/TSocket.h>
+#include <thrift/concurrency/ThreadManager.h>
 #include <climits>
-#include <concurrency/Thread.h>
-#include <concurrency/PlatformThreadFactory.h>
-#include <concurrency/Mutex.h>
+#include <thrift/concurrency/Thread.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
+#include <thrift/concurrency/Mutex.h>
 #include <stack>
 #include <vector>
 #include <string>
diff --git a/lib/cpp/src/server/TServer.cpp b/lib/cpp/src/thrift/server/TServer.cpp
similarity index 100%
rename from lib/cpp/src/server/TServer.cpp
rename to lib/cpp/src/thrift/server/TServer.cpp
diff --git a/lib/cpp/src/server/TServer.h b/lib/cpp/src/thrift/server/TServer.h
similarity index 98%
rename from lib/cpp/src/server/TServer.h
rename to lib/cpp/src/thrift/server/TServer.h
index 42bfc9d..f172ad1 100644
--- a/lib/cpp/src/server/TServer.h
+++ b/lib/cpp/src/thrift/server/TServer.h
@@ -20,10 +20,10 @@
 #ifndef _THRIFT_SERVER_TSERVER_H_
 #define _THRIFT_SERVER_TSERVER_H_ 1
 
-#include <TProcessor.h>
-#include <transport/TServerTransport.h>
-#include <protocol/TBinaryProtocol.h>
-#include <concurrency/Thread.h>
+#include <thrift/TProcessor.h>
+#include <thrift/transport/TServerTransport.h>
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/concurrency/Thread.h>
 
 #include <boost/shared_ptr.hpp>
 
diff --git a/lib/cpp/src/server/TSimpleServer.cpp b/lib/cpp/src/thrift/server/TSimpleServer.cpp
similarity index 97%
rename from lib/cpp/src/server/TSimpleServer.cpp
rename to lib/cpp/src/thrift/server/TSimpleServer.cpp
index 344945b..b132a66 100644
--- a/lib/cpp/src/server/TSimpleServer.cpp
+++ b/lib/cpp/src/thrift/server/TSimpleServer.cpp
@@ -17,8 +17,8 @@
  * under the License.
  */
 
-#include "server/TSimpleServer.h"
-#include "transport/TTransportException.h"
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/transport/TTransportException.h>
 #include <string>
 #include <iostream>
 
diff --git a/lib/cpp/src/server/TSimpleServer.h b/lib/cpp/src/thrift/server/TSimpleServer.h
similarity index 97%
rename from lib/cpp/src/server/TSimpleServer.h
rename to lib/cpp/src/thrift/server/TSimpleServer.h
index ea40ab0..f9e0e2b 100644
--- a/lib/cpp/src/server/TSimpleServer.h
+++ b/lib/cpp/src/thrift/server/TSimpleServer.h
@@ -20,8 +20,8 @@
 #ifndef _THRIFT_SERVER_TSIMPLESERVER_H_
 #define _THRIFT_SERVER_TSIMPLESERVER_H_ 1
 
-#include "server/TServer.h"
-#include "transport/TServerTransport.h"
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TServerTransport.h>
 
 namespace apache { namespace thrift { namespace server {
 
diff --git a/lib/cpp/src/server/TThreadPoolServer.cpp b/lib/cpp/src/thrift/server/TThreadPoolServer.cpp
similarity index 96%
rename from lib/cpp/src/server/TThreadPoolServer.cpp
rename to lib/cpp/src/thrift/server/TThreadPoolServer.cpp
index fe58ff3..db63951 100644
--- a/lib/cpp/src/server/TThreadPoolServer.cpp
+++ b/lib/cpp/src/thrift/server/TThreadPoolServer.cpp
@@ -21,10 +21,10 @@
 #include <config.h>
 #endif
 
-#include "server/TThreadPoolServer.h"
-#include "transport/TTransportException.h"
-#include "concurrency/Thread.h"
-#include "concurrency/ThreadManager.h"
+#include <thrift/server/TThreadPoolServer.h>
+#include <thrift/transport/TTransportException.h>
+#include <thrift/concurrency/Thread.h>
+#include <thrift/concurrency/ThreadManager.h>
 #include <string>
 #include <iostream>
 
diff --git a/lib/cpp/src/server/TThreadPoolServer.h b/lib/cpp/src/thrift/server/TThreadPoolServer.h
similarity index 96%
rename from lib/cpp/src/server/TThreadPoolServer.h
rename to lib/cpp/src/thrift/server/TThreadPoolServer.h
index b860ae2..48a11cb 100644
--- a/lib/cpp/src/server/TThreadPoolServer.h
+++ b/lib/cpp/src/thrift/server/TThreadPoolServer.h
@@ -20,9 +20,9 @@
 #ifndef _THRIFT_SERVER_TTHREADPOOLSERVER_H_
 #define _THRIFT_SERVER_TTHREADPOOLSERVER_H_ 1
 
-#include <concurrency/ThreadManager.h>
-#include <server/TServer.h>
-#include <transport/TServerTransport.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TServerTransport.h>
 
 #include <boost/shared_ptr.hpp>
 
diff --git a/lib/cpp/src/server/TThreadedServer.cpp b/lib/cpp/src/thrift/server/TThreadedServer.cpp
similarity index 97%
rename from lib/cpp/src/server/TThreadedServer.cpp
rename to lib/cpp/src/thrift/server/TThreadedServer.cpp
index e99a909..6ed8fd8 100644
--- a/lib/cpp/src/server/TThreadedServer.cpp
+++ b/lib/cpp/src/thrift/server/TThreadedServer.cpp
@@ -17,9 +17,9 @@
  * under the License.
  */
 
-#include "server/TThreadedServer.h"
-#include "transport/TTransportException.h"
-#include <concurrency/PlatformThreadFactory.h>
+#include <thrift/server/TThreadedServer.h>
+#include <thrift/transport/TTransportException.h>
+#include <thrift/concurrency/PlatformThreadFactory.h>
 
 #include <string>
 #include <iostream>
diff --git a/lib/cpp/src/server/TThreadedServer.h b/lib/cpp/src/thrift/server/TThreadedServer.h
similarity index 96%
rename from lib/cpp/src/server/TThreadedServer.h
rename to lib/cpp/src/thrift/server/TThreadedServer.h
index 2db3fac..42faaf0 100644
--- a/lib/cpp/src/server/TThreadedServer.h
+++ b/lib/cpp/src/thrift/server/TThreadedServer.h
@@ -20,10 +20,10 @@
 #ifndef _THRIFT_SERVER_TTHREADEDSERVER_H_
 #define _THRIFT_SERVER_TTHREADEDSERVER_H_ 1
 
-#include <server/TServer.h>
-#include <transport/TServerTransport.h>
-#include <concurrency/Monitor.h>
-#include <concurrency/Thread.h>
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TServerTransport.h>
+#include <thrift/concurrency/Monitor.h>
+#include <thrift/concurrency/Thread.h>
 
 #include <boost/shared_ptr.hpp>
 
diff --git a/lib/cpp/src/transport/TBufferTransports.cpp b/lib/cpp/src/thrift/transport/TBufferTransports.cpp
similarity index 99%
rename from lib/cpp/src/transport/TBufferTransports.cpp
rename to lib/cpp/src/thrift/transport/TBufferTransports.cpp
index b8a7ec3..a2cc066 100644
--- a/lib/cpp/src/transport/TBufferTransports.cpp
+++ b/lib/cpp/src/thrift/transport/TBufferTransports.cpp
@@ -20,7 +20,7 @@
 #include <cassert>
 #include <algorithm>
 
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 
 using std::string;
 
diff --git a/lib/cpp/src/transport/TBufferTransports.h b/lib/cpp/src/thrift/transport/TBufferTransports.h
similarity index 99%
rename from lib/cpp/src/transport/TBufferTransports.h
rename to lib/cpp/src/thrift/transport/TBufferTransports.h
index 5f8257e..b5570f5 100644
--- a/lib/cpp/src/transport/TBufferTransports.h
+++ b/lib/cpp/src/thrift/transport/TBufferTransports.h
@@ -23,8 +23,8 @@
 #include <cstring>
 #include "boost/scoped_array.hpp"
 
-#include <transport/TTransport.h>
-#include <transport/TVirtualTransport.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/transport/TVirtualTransport.h>
 
 #ifdef __GNUC__
 #define TDB_LIKELY(val) (__builtin_expect((val), 1))
diff --git a/lib/cpp/src/transport/TFDTransport.cpp b/lib/cpp/src/thrift/transport/TFDTransport.cpp
similarity index 98%
rename from lib/cpp/src/transport/TFDTransport.cpp
rename to lib/cpp/src/thrift/transport/TFDTransport.cpp
index a47e2a4..fb9cc57 100644
--- a/lib/cpp/src/transport/TFDTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TFDTransport.cpp
@@ -20,7 +20,7 @@
 #include <cerrno>
 #include <exception>
 
-#include <transport/TFDTransport.h>
+#include <thrift/transport/TFDTransport.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
diff --git a/lib/cpp/src/transport/TFDTransport.h b/lib/cpp/src/thrift/transport/TFDTransport.h
similarity index 100%
rename from lib/cpp/src/transport/TFDTransport.h
rename to lib/cpp/src/thrift/transport/TFDTransport.h
diff --git a/lib/cpp/src/transport/TFileTransport.cpp b/lib/cpp/src/thrift/transport/TFileTransport.cpp
similarity index 100%
rename from lib/cpp/src/transport/TFileTransport.cpp
rename to lib/cpp/src/thrift/transport/TFileTransport.cpp
diff --git a/lib/cpp/src/transport/TFileTransport.h b/lib/cpp/src/thrift/transport/TFileTransport.h
similarity index 98%
rename from lib/cpp/src/transport/TFileTransport.h
rename to lib/cpp/src/thrift/transport/TFileTransport.h
index b0e48d1..e27f5a6 100644
--- a/lib/cpp/src/transport/TFileTransport.h
+++ b/lib/cpp/src/thrift/transport/TFileTransport.h
@@ -20,9 +20,9 @@
 #ifndef _THRIFT_TRANSPORT_TFILETRANSPORT_H_
 #define _THRIFT_TRANSPORT_TFILETRANSPORT_H_ 1
 
-#include "TTransport.h"
-#include "Thrift.h"
-#include "TProcessor.h"
+#include <thrift/transport/TTransport.h>
+#include <thrift/Thrift.h>
+#include <thrift/TProcessor.h>
 
 #include <string>
 #include <stdio.h>
@@ -38,8 +38,8 @@
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include "concurrency/Mutex.h"
-#include "concurrency/Monitor.h"
+#include <thrift/concurrency/Mutex.h>
+#include <thrift/concurrency/Monitor.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpClient.cpp b/lib/cpp/src/thrift/transport/THttpClient.cpp
similarity index 97%
rename from lib/cpp/src/transport/THttpClient.cpp
rename to lib/cpp/src/thrift/transport/THttpClient.cpp
index 04864ce..adfc959 100644
--- a/lib/cpp/src/transport/THttpClient.cpp
+++ b/lib/cpp/src/thrift/transport/THttpClient.cpp
@@ -21,8 +21,8 @@
 #include <sstream>
 #include <boost/algorithm/string.hpp>
 
-#include <transport/THttpClient.h>
-#include <transport/TSocket.h>
+#include <thrift/transport/THttpClient.h>
+#include <thrift/transport/TSocket.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpClient.h b/lib/cpp/src/thrift/transport/THttpClient.h
similarity index 96%
rename from lib/cpp/src/transport/THttpClient.h
rename to lib/cpp/src/thrift/transport/THttpClient.h
index 142063d..0898b11 100644
--- a/lib/cpp/src/transport/THttpClient.h
+++ b/lib/cpp/src/thrift/transport/THttpClient.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_TRANSPORT_THTTPCLIENT_H_
 #define _THRIFT_TRANSPORT_THTTPCLIENT_H_ 1
 
-#include <transport/THttpTransport.h>
+#include <thrift/transport/THttpTransport.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpServer.cpp b/lib/cpp/src/thrift/transport/THttpServer.cpp
similarity index 97%
rename from lib/cpp/src/transport/THttpServer.cpp
rename to lib/cpp/src/thrift/transport/THttpServer.cpp
index 166c0f6..b10e6da 100644
--- a/lib/cpp/src/transport/THttpServer.cpp
+++ b/lib/cpp/src/thrift/transport/THttpServer.cpp
@@ -21,8 +21,8 @@
 #include <sstream>
 #include <iostream>
 
-#include <transport/THttpServer.h>
-#include <transport/TSocket.h>
+#include <thrift/transport/THttpServer.h>
+#include <thrift/transport/TSocket.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpServer.h b/lib/cpp/src/thrift/transport/THttpServer.h
similarity index 97%
rename from lib/cpp/src/transport/THttpServer.h
rename to lib/cpp/src/thrift/transport/THttpServer.h
index 6523408..bf69dbe 100644
--- a/lib/cpp/src/transport/THttpServer.h
+++ b/lib/cpp/src/thrift/transport/THttpServer.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_TRANSPORT_THTTPSERVER_H_
 #define _THRIFT_TRANSPORT_THTTPSERVER_H_ 1
 
-#include <transport/THttpTransport.h>
+#include <thrift/transport/THttpTransport.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpTransport.cpp b/lib/cpp/src/thrift/transport/THttpTransport.cpp
similarity index 98%
rename from lib/cpp/src/transport/THttpTransport.cpp
rename to lib/cpp/src/thrift/transport/THttpTransport.cpp
index 95fe207..3bda20e 100644
--- a/lib/cpp/src/transport/THttpTransport.cpp
+++ b/lib/cpp/src/thrift/transport/THttpTransport.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <transport/THttpTransport.h>
+#include <thrift/transport/THttpTransport.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/THttpTransport.h b/lib/cpp/src/thrift/transport/THttpTransport.h
similarity index 97%
rename from lib/cpp/src/transport/THttpTransport.h
rename to lib/cpp/src/thrift/transport/THttpTransport.h
index 977c65f..9997c93 100644
--- a/lib/cpp/src/transport/THttpTransport.h
+++ b/lib/cpp/src/thrift/transport/THttpTransport.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_TRANSPORT_THTTPTRANSPORT_H_
 #define _THRIFT_TRANSPORT_THTTPTRANSPORT_H_ 1
 
-#include <transport/TBufferTransports.h>
+#include <thrift/transport/TBufferTransports.h>
 #include "TVirtualTransport.h"
 
 namespace apache { namespace thrift { namespace transport {
diff --git a/lib/cpp/src/transport/TSSLServerSocket.cpp b/lib/cpp/src/thrift/transport/TSSLServerSocket.cpp
similarity index 100%
rename from lib/cpp/src/transport/TSSLServerSocket.cpp
rename to lib/cpp/src/thrift/transport/TSSLServerSocket.cpp
diff --git a/lib/cpp/src/transport/TSSLServerSocket.h b/lib/cpp/src/thrift/transport/TSSLServerSocket.h
similarity index 100%
rename from lib/cpp/src/transport/TSSLServerSocket.h
rename to lib/cpp/src/thrift/transport/TSSLServerSocket.h
diff --git a/lib/cpp/src/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
similarity index 99%
rename from lib/cpp/src/transport/TSSLSocket.cpp
rename to lib/cpp/src/thrift/transport/TSSLSocket.cpp
index 522d293..14c13dc 100755
--- a/lib/cpp/src/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -35,7 +35,7 @@
 #include <openssl/rand.h>
 #include <openssl/ssl.h>
 #include <openssl/x509v3.h>
-#include "concurrency/Mutex.h"
+#include <thrift/concurrency/Mutex.h>
 #include "TSSLSocket.h"
 
 #define OPENSSL_VERSION_NO_THREAD_ID 0x10000000L
diff --git a/lib/cpp/src/transport/TSSLSocket.h b/lib/cpp/src/thrift/transport/TSSLSocket.h
similarity index 99%
rename from lib/cpp/src/transport/TSSLSocket.h
rename to lib/cpp/src/thrift/transport/TSSLSocket.h
index a0a1502..d77c2f5 100755
--- a/lib/cpp/src/transport/TSSLSocket.h
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.h
@@ -23,7 +23,7 @@
 #include <string>
 #include <boost/shared_ptr.hpp>
 #include <openssl/ssl.h>
-#include "concurrency/Mutex.h"
+#include <thrift/concurrency/Mutex.h>
 #include "TSocket.h"
 
 namespace apache { namespace thrift { namespace transport {
diff --git a/lib/cpp/src/transport/TServerSocket.cpp b/lib/cpp/src/thrift/transport/TServerSocket.cpp
similarity index 100%
rename from lib/cpp/src/transport/TServerSocket.cpp
rename to lib/cpp/src/thrift/transport/TServerSocket.cpp
diff --git a/lib/cpp/src/transport/TServerSocket.h b/lib/cpp/src/thrift/transport/TServerSocket.h
similarity index 100%
rename from lib/cpp/src/transport/TServerSocket.h
rename to lib/cpp/src/thrift/transport/TServerSocket.h
diff --git a/lib/cpp/src/transport/TServerTransport.h b/lib/cpp/src/thrift/transport/TServerTransport.h
similarity index 100%
rename from lib/cpp/src/transport/TServerTransport.h
rename to lib/cpp/src/thrift/transport/TServerTransport.h
diff --git a/lib/cpp/src/transport/TShortReadTransport.h b/lib/cpp/src/thrift/transport/TShortReadTransport.h
similarity index 95%
rename from lib/cpp/src/transport/TShortReadTransport.h
rename to lib/cpp/src/thrift/transport/TShortReadTransport.h
index 0d0eb86..b5cdc7d 100644
--- a/lib/cpp/src/transport/TShortReadTransport.h
+++ b/lib/cpp/src/thrift/transport/TShortReadTransport.h
@@ -20,10 +20,10 @@
 #ifndef _THRIFT_TRANSPORT_TSHORTREADTRANSPORT_H_
 #define _THRIFT_TRANSPORT_TSHORTREADTRANSPORT_H_ 1
 
-#include <cstdlib>
+#include <thrift/cstdlib>
 
-#include <transport/TTransport.h>
-#include <transport/TVirtualTransport.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/transport/TVirtualTransport.h>
 
 namespace apache { namespace thrift { namespace transport { namespace test {
 
diff --git a/lib/cpp/src/transport/TSimpleFileTransport.cpp b/lib/cpp/src/thrift/transport/TSimpleFileTransport.cpp
similarity index 100%
rename from lib/cpp/src/transport/TSimpleFileTransport.cpp
rename to lib/cpp/src/thrift/transport/TSimpleFileTransport.cpp
diff --git a/lib/cpp/src/transport/TSimpleFileTransport.h b/lib/cpp/src/thrift/transport/TSimpleFileTransport.h
similarity index 100%
rename from lib/cpp/src/transport/TSimpleFileTransport.h
rename to lib/cpp/src/thrift/transport/TSimpleFileTransport.h
diff --git a/lib/cpp/src/transport/TSocket.cpp b/lib/cpp/src/thrift/transport/TSocket.cpp
similarity index 99%
rename from lib/cpp/src/transport/TSocket.cpp
rename to lib/cpp/src/thrift/transport/TSocket.cpp
index a0cc77a..3c235d2 100644
--- a/lib/cpp/src/transport/TSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSocket.cpp
@@ -45,7 +45,7 @@
 #include <errno.h>
 #include <fcntl.h>
 
-#include "concurrency/Monitor.h"
+#include <thrift/concurrency/Monitor.h>
 #include "TSocket.h"
 #include "TTransportException.h"
 
diff --git a/lib/cpp/src/transport/TSocket.h b/lib/cpp/src/thrift/transport/TSocket.h
similarity index 100%
rename from lib/cpp/src/transport/TSocket.h
rename to lib/cpp/src/thrift/transport/TSocket.h
diff --git a/lib/cpp/src/transport/TSocketPool.cpp b/lib/cpp/src/thrift/transport/TSocketPool.cpp
similarity index 100%
rename from lib/cpp/src/transport/TSocketPool.cpp
rename to lib/cpp/src/thrift/transport/TSocketPool.cpp
diff --git a/lib/cpp/src/transport/TSocketPool.h b/lib/cpp/src/thrift/transport/TSocketPool.h
similarity index 100%
rename from lib/cpp/src/transport/TSocketPool.h
rename to lib/cpp/src/thrift/transport/TSocketPool.h
diff --git a/lib/cpp/src/transport/TTransport.h b/lib/cpp/src/thrift/transport/TTransport.h
similarity index 98%
rename from lib/cpp/src/transport/TTransport.h
rename to lib/cpp/src/thrift/transport/TTransport.h
index fa0ed8a..3b552c4 100644
--- a/lib/cpp/src/transport/TTransport.h
+++ b/lib/cpp/src/thrift/transport/TTransport.h
@@ -20,9 +20,9 @@
 #ifndef _THRIFT_TRANSPORT_TTRANSPORT_H_
 #define _THRIFT_TRANSPORT_TTRANSPORT_H_ 1
 
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 #include <boost/shared_ptr.hpp>
-#include <transport/TTransportException.h>
+#include <thrift/transport/TTransportException.h>
 #include <string>
 
 namespace apache { namespace thrift { namespace transport {
diff --git a/lib/cpp/src/transport/TTransportException.cpp b/lib/cpp/src/thrift/transport/TTransportException.cpp
similarity index 95%
rename from lib/cpp/src/transport/TTransportException.cpp
rename to lib/cpp/src/thrift/transport/TTransportException.cpp
index f0aaedc..e24198a 100644
--- a/lib/cpp/src/transport/TTransportException.cpp
+++ b/lib/cpp/src/thrift/transport/TTransportException.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <transport/TTransportException.h>
+#include <thrift/transport/TTransportException.h>
 #include <boost/lexical_cast.hpp>
 #include <cstring>
 #include <config.h>
diff --git a/lib/cpp/src/transport/TTransportException.h b/lib/cpp/src/thrift/transport/TTransportException.h
similarity index 98%
rename from lib/cpp/src/transport/TTransportException.h
rename to lib/cpp/src/thrift/transport/TTransportException.h
index e0630ef..028dbb8 100644
--- a/lib/cpp/src/transport/TTransportException.h
+++ b/lib/cpp/src/thrift/transport/TTransportException.h
@@ -21,7 +21,7 @@
 #define _THRIFT_TRANSPORT_TTRANSPORTEXCEPTION_H_ 1
 
 #include <string>
-#include <Thrift.h>
+#include <thrift/Thrift.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/TTransportUtils.cpp b/lib/cpp/src/thrift/transport/TTransportUtils.cpp
similarity index 98%
rename from lib/cpp/src/transport/TTransportUtils.cpp
rename to lib/cpp/src/thrift/transport/TTransportUtils.cpp
index 72289bc..44f6101 100644
--- a/lib/cpp/src/transport/TTransportUtils.cpp
+++ b/lib/cpp/src/thrift/transport/TTransportUtils.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include <transport/TTransportUtils.h>
+#include <thrift/transport/TTransportUtils.h>
 
 using std::string;
 
diff --git a/lib/cpp/src/transport/TTransportUtils.h b/lib/cpp/src/thrift/transport/TTransportUtils.h
similarity index 98%
rename from lib/cpp/src/transport/TTransportUtils.h
rename to lib/cpp/src/thrift/transport/TTransportUtils.h
index d7cdaad..aa294b4 100644
--- a/lib/cpp/src/transport/TTransportUtils.h
+++ b/lib/cpp/src/thrift/transport/TTransportUtils.h
@@ -24,10 +24,10 @@
 #include <cstring>
 #include <string>
 #include <algorithm>
-#include <transport/TTransport.h>
+#include <thrift/transport/TTransport.h>
 // Include the buffered transports that used to be defined here.
-#include <transport/TBufferTransports.h>
-#include <transport/TFileTransport.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/transport/TFileTransport.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/TVirtualTransport.h b/lib/cpp/src/thrift/transport/TVirtualTransport.h
similarity index 98%
rename from lib/cpp/src/transport/TVirtualTransport.h
rename to lib/cpp/src/thrift/transport/TVirtualTransport.h
index 1760681..575f547 100644
--- a/lib/cpp/src/transport/TVirtualTransport.h
+++ b/lib/cpp/src/thrift/transport/TVirtualTransport.h
@@ -20,7 +20,7 @@
 #ifndef _THRIFT_TRANSPORT_TVIRTUALTRANSPORT_H_
 #define _THRIFT_TRANSPORT_TVIRTUALTRANSPORT_H_ 1
 
-#include <transport/TTransport.h>
+#include <thrift/transport/TTransport.h>
 
 namespace apache { namespace thrift { namespace transport {
 
diff --git a/lib/cpp/src/transport/TZlibTransport.cpp b/lib/cpp/src/thrift/transport/TZlibTransport.cpp
similarity index 99%
rename from lib/cpp/src/transport/TZlibTransport.cpp
rename to lib/cpp/src/thrift/transport/TZlibTransport.cpp
index be65288..fc407cb 100644
--- a/lib/cpp/src/transport/TZlibTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TZlibTransport.cpp
@@ -20,7 +20,7 @@
 #include <cassert>
 #include <cstring>
 #include <algorithm>
-#include <transport/TZlibTransport.h>
+#include <thrift/transport/TZlibTransport.h>
 #include <zlib.h>
 
 using std::string;
diff --git a/lib/cpp/src/transport/TZlibTransport.h b/lib/cpp/src/thrift/transport/TZlibTransport.h
similarity index 98%
rename from lib/cpp/src/transport/TZlibTransport.h
rename to lib/cpp/src/thrift/transport/TZlibTransport.h
index db76523..b365641 100644
--- a/lib/cpp/src/transport/TZlibTransport.h
+++ b/lib/cpp/src/thrift/transport/TZlibTransport.h
@@ -21,8 +21,8 @@
 #define _THRIFT_TRANSPORT_TZLIBTRANSPORT_H_ 1
 
 #include <boost/lexical_cast.hpp>
-#include <transport/TTransport.h>
-#include <transport/TVirtualTransport.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/transport/TVirtualTransport.h>
 
 struct z_stream_s;
 
diff --git a/lib/cpp/src/windows/GetTimeOfDay.cpp b/lib/cpp/src/thrift/windows/GetTimeOfDay.cpp
similarity index 100%
rename from lib/cpp/src/windows/GetTimeOfDay.cpp
rename to lib/cpp/src/thrift/windows/GetTimeOfDay.cpp
diff --git a/lib/cpp/src/windows/GetTimeOfDay.h b/lib/cpp/src/thrift/windows/GetTimeOfDay.h
similarity index 100%
rename from lib/cpp/src/windows/GetTimeOfDay.h
rename to lib/cpp/src/thrift/windows/GetTimeOfDay.h
diff --git a/lib/cpp/src/windows/Operators.h b/lib/cpp/src/thrift/windows/Operators.h
similarity index 100%
rename from lib/cpp/src/windows/Operators.h
rename to lib/cpp/src/thrift/windows/Operators.h
diff --git a/lib/cpp/src/windows/SocketPair.cpp b/lib/cpp/src/thrift/windows/SocketPair.cpp
similarity index 100%
rename from lib/cpp/src/windows/SocketPair.cpp
rename to lib/cpp/src/thrift/windows/SocketPair.cpp
diff --git a/lib/cpp/src/windows/SocketPair.h b/lib/cpp/src/thrift/windows/SocketPair.h
similarity index 100%
rename from lib/cpp/src/windows/SocketPair.h
rename to lib/cpp/src/thrift/windows/SocketPair.h
diff --git a/lib/cpp/src/windows/StdAfx.cpp b/lib/cpp/src/thrift/windows/StdAfx.cpp
similarity index 100%
rename from lib/cpp/src/windows/StdAfx.cpp
rename to lib/cpp/src/thrift/windows/StdAfx.cpp
diff --git a/lib/cpp/src/windows/StdAfx.h b/lib/cpp/src/thrift/windows/StdAfx.h
similarity index 100%
rename from lib/cpp/src/windows/StdAfx.h
rename to lib/cpp/src/thrift/windows/StdAfx.h
diff --git a/lib/cpp/src/windows/TWinsockSingleton.cpp b/lib/cpp/src/thrift/windows/TWinsockSingleton.cpp
similarity index 100%
rename from lib/cpp/src/windows/TWinsockSingleton.cpp
rename to lib/cpp/src/thrift/windows/TWinsockSingleton.cpp
diff --git a/lib/cpp/src/windows/TWinsockSingleton.h b/lib/cpp/src/thrift/windows/TWinsockSingleton.h
similarity index 100%
rename from lib/cpp/src/windows/TWinsockSingleton.h
rename to lib/cpp/src/thrift/windows/TWinsockSingleton.h
diff --git a/lib/cpp/src/windows/TargetVersion.h b/lib/cpp/src/thrift/windows/TargetVersion.h
similarity index 100%
rename from lib/cpp/src/windows/TargetVersion.h
rename to lib/cpp/src/thrift/windows/TargetVersion.h
diff --git a/lib/cpp/src/windows/WinFcntl.cpp b/lib/cpp/src/thrift/windows/WinFcntl.cpp
similarity index 100%
rename from lib/cpp/src/windows/WinFcntl.cpp
rename to lib/cpp/src/thrift/windows/WinFcntl.cpp
diff --git a/lib/cpp/src/windows/WinFcntl.h b/lib/cpp/src/thrift/windows/WinFcntl.h
similarity index 100%
rename from lib/cpp/src/windows/WinFcntl.h
rename to lib/cpp/src/thrift/windows/WinFcntl.h
diff --git a/lib/cpp/src/windows/config.h b/lib/cpp/src/thrift/windows/config.h
similarity index 100%
rename from lib/cpp/src/windows/config.h
rename to lib/cpp/src/thrift/windows/config.h
diff --git a/lib/cpp/src/windows/force_inc.h b/lib/cpp/src/thrift/windows/force_inc.h
similarity index 97%
rename from lib/cpp/src/windows/force_inc.h
rename to lib/cpp/src/thrift/windows/force_inc.h
index 803d132..f9af312 100644
--- a/lib/cpp/src/windows/force_inc.h
+++ b/lib/cpp/src/thrift/windows/force_inc.h
@@ -42,7 +42,7 @@
 #  define _WIN32_WINNT 0x0601
 #endif
 
-#include "windows/config.h"
+#include <thrift/windows/config.h>
 
 #undef gai_strerror
 #define gai_strerror gai_strerrorA
diff --git a/lib/cpp/src/windows/tr1/functional b/lib/cpp/src/thrift/windows/tr1/functional
similarity index 100%
rename from lib/cpp/src/windows/tr1/functional
rename to lib/cpp/src/thrift/windows/tr1/functional
diff --git a/lib/cpp/src/transport/TPipe.cpp b/lib/cpp/src/transport/TPipe.cpp
deleted file mode 100644
index 2c7cf56..0000000
--- a/lib/cpp/src/transport/TPipe.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-#ifdef _WIN32
-
-#include "TTransportException.h"
-#include "TPipe.h"
-
-namespace apache { namespace thrift { namespace transport {
-
-using namespace std;
-
-/**
-* TPipe implementation.
-*/
-
-//---- Constructors ----
-TPipe::TPipe(HANDLE hpipe) :
-  pipename_(""),
-  hPipe_(hpipe),
-  TimeoutSeconds_(3),
-  isAnonymous(false)
-{}
-
-TPipe::TPipe(string pipename) :
-  pipename_(pipename),
-  hPipe_(INVALID_HANDLE_VALUE),
-  TimeoutSeconds_(3),
-  isAnonymous(false)
-{}
-
-TPipe::TPipe(HANDLE hPipeRd, HANDLE hPipeWrt) :
-  pipename_(""),
-  hPipe_(hPipeRd),
-  hPipeWrt_(hPipeWrt),
-  TimeoutSeconds_(3),
-  isAnonymous(true)
-{}
-
-  TPipe::TPipe() :
-  pipename_(""),
-  hPipe_(INVALID_HANDLE_VALUE),
-  TimeoutSeconds_(3)
-{}
-
-//---- Destructor ----
-TPipe::~TPipe() {
-  close();
-}
-
-
-bool TPipe::isOpen() {
-  return (hPipe_ != INVALID_HANDLE_VALUE);
-}
-
-//---------------------------------------------------------
-// Transport callbacks
-//---------------------------------------------------------
-
-bool TPipe::peek() {
-  if (!isOpen()) {
-    return false;
-  }
-  DWORD bytesavail = 0;
-  int  PeekRet = 0;
-  PeekRet = PeekNamedPipe(hPipe_, NULL, 0, NULL, &bytesavail, NULL); 
-  return (PeekRet != 0 && bytesavail > 0);
-}
-
-void TPipe::open() {
-  if (isOpen()) {
-    return;
-  }
-
-  int SleepInterval = 500; //ms
-  int retries = TimeoutSeconds_ * 1000 / SleepInterval;
-  for(int i=0; i<retries; i++)
-  {
-    hPipe_ = CreateFile( 
-              pipename_.c_str(),
-              GENERIC_READ | GENERIC_WRITE, 
-              0,              // no sharing 
-              NULL,           // default security attributes
-              OPEN_EXISTING,  // opens existing pipe 
-              0,              // default attributes 
-              NULL);          // no template file 
-
-    if (hPipe_ == INVALID_HANDLE_VALUE) 
-      sleep(SleepInterval);
-    else
-      break;
-  }
-  if (hPipe_ == INVALID_HANDLE_VALUE) 
-    throw TTransportException(TTransportException::NOT_OPEN, "Unable to open pipe");
-
-  // The pipe connected; change to message-read mode. 
-  DWORD dwMode = PIPE_READMODE_MESSAGE; 
-  int fSuccess = SetNamedPipeHandleState( 
-              hPipe_,   // pipe handle 
-              &dwMode,  // new pipe mode 
-              NULL,     // don't set maximum bytes 
-              NULL);    // don't set maximum time 
-  if (fSuccess == 0)
-  {
-    throw TTransportException(TTransportException::NOT_OPEN, "SetNamedPipeHandleState failed");
-    close();
-  }
-}
-
-
-void TPipe::close() {
-  if (isOpen())
-  {
-    CloseHandle(hPipe_);
-    hPipe_ = INVALID_HANDLE_VALUE;
-  }
-}
-
-uint32_t TPipe::read(uint8_t* buf, uint32_t len) {
-  if (!isOpen())
-    throw TTransportException(TTransportException::NOT_OPEN, "Called read on non-open pipe");
-
-  DWORD  cbRead; 
-  int fSuccess = ReadFile( 
-              hPipe_,   // pipe handle 
-              buf,      // buffer to receive reply 
-              len,      // size of buffer 
-              &cbRead,  // number of bytes read 
-              NULL);    // not overlapped 
-
-  if ( !fSuccess && GetLastError() != ERROR_MORE_DATA )
-    return 0; // No more data, possibly because client disconnected.
-
-  return cbRead;
-}
-
-void TPipe::write(const uint8_t* buf, uint32_t len) {
-  if (!isOpen())
-    throw TTransportException(TTransportException::NOT_OPEN, "Called write on non-open pipe");
-
-  HANDLE WritePipe = isAnonymous? hPipeWrt_: hPipe_;
-  DWORD  cbWritten; 
-  int fSuccess = WriteFile( 
-              WritePipe,     // pipe handle 
-              buf,        // message 
-              len,        // message length 
-              &cbWritten, // bytes written 
-              NULL);      // not overlapped 
-
-  if ( !fSuccess) 
-    throw TTransportException(TTransportException::NOT_OPEN, "Write to pipe failed");
-}
-
-
-//---------------------------------------------------------
-// Accessors
-//---------------------------------------------------------
-
-string TPipe::getPipename() {
-  return pipename_;
-}
-
-void TPipe::setPipename(std::string pipename) {
-  pipename_ = pipename;
-}
-
-HANDLE TPipe::getPipeHandle() {
-  return hPipe_;
-}
-
-void TPipe::setPipeHandle(HANDLE pipehandle) {
-  hPipe_ = pipehandle;
-}
-
-HANDLE TPipe::getWrtPipeHandle() {
-  return hPipeWrt_;
-}
-
-void TPipe::setWrtPipeHandle(HANDLE pipehandle) {
-  hPipeWrt_ = pipehandle;
-}
-
-long TPipe::getConnectTimeout() {
-  return TimeoutSeconds_;
-}
-
-void TPipe::setConnectTimeout(long seconds) {
-  TimeoutSeconds_ = seconds;
-}
-
-}}} // apache::thrift::transport
-
-#endif //_WIN32
diff --git a/lib/cpp/src/transport/TPipe.h b/lib/cpp/src/transport/TPipe.h
deleted file mode 100644
index bca3e27..0000000
--- a/lib/cpp/src/transport/TPipe.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_TPIPE_H_
-#define _THRIFT_TRANSPORT_TPIPE_H_ 1
-#ifdef _WIN32
-
-#include "TTransport.h"
-#include "TVirtualTransport.h"
-
-namespace apache { namespace thrift { namespace transport {
-
-/**
- * Windows Pipes implementation of the TTransport interface.
- *
- */
-class TPipe : public TVirtualTransport<TPipe> {
- public:
-
-  // Constructs a new pipe object.
-  TPipe();
-  // Named pipe constructors -
-  TPipe(HANDLE hPipe);
-  TPipe(std::string path);
-  // Anonymous pipe -
-  TPipe(HANDLE hPipeRd, HANDLE hPipeWrt);
-
-  // Destroys the pipe object, closing it if necessary.
-  virtual ~TPipe();
-
-  // Returns whether the pipe is open & valid.
-  virtual bool isOpen();
-
-  // Checks whether more data is available in the pipe.
-  virtual bool peek();
-
-  // Creates and opens the named/anonymous pipe.
-  virtual void open();
-
-  // Shuts down communications on the pipe.
-  virtual void close();
-
-  // Reads from the pipe.
-  virtual uint32_t read(uint8_t* buf, uint32_t len);
-
-  // Writes to the pipe.
-  virtual void write(const uint8_t* buf, uint32_t len);
-
-
-  //Accessors
-  std::string getPipename();
-  void setPipename(std::string pipename);
-  HANDLE getPipeHandle(); //doubles as the read handle for anon pipe
-  void setPipeHandle(HANDLE pipehandle);
-  HANDLE getWrtPipeHandle();
-  void setWrtPipeHandle(HANDLE pipehandle);
-  long getConnectTimeout();
-  void setConnectTimeout(long seconds);
-
- private:
-  std::string pipename_;
-  //Named pipe handles are R/W, while anonymous pipes are one or the other (half duplex).
-  HANDLE hPipe_, hPipeWrt_;
-  long TimeoutSeconds_;
-  bool isAnonymous;
-
-};
-
-}}} // apache::thrift::transport
-
-#endif //_WIN32
-#endif // #ifndef _THRIFT_TRANSPORT_TPIPE_H_
-
diff --git a/lib/cpp/src/transport/TPipeServer.cpp b/lib/cpp/src/transport/TPipeServer.cpp
deleted file mode 100644
index 6f2f73d..0000000
--- a/lib/cpp/src/transport/TPipeServer.cpp
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef _WIN32
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <cstring>
-
-#include "TPipe.h"
-#include "TPipeServer.h"
-#include <boost/shared_ptr.hpp>
-#include <AccCtrl.h>
-#include <Aclapi.h>
-
-namespace apache { namespace thrift { namespace transport {
-
-using namespace std;
-using boost::shared_ptr;
-
-//---- Constructors ----
-TPipeServer::TPipeServer(string pipename, uint32_t bufsize) :
-  pipename_(pipename),
-  bufsize_(bufsize),
-  hPipe_(INVALID_HANDLE_VALUE),
-  isAnonymous(false),
-  maxconns_(TPIPE_SERVER_MAX_CONNS_DEFAULT)
- {}
-
-TPipeServer::TPipeServer(string pipename, uint32_t bufsize, uint32_t maxconnections) :
-  pipename_(pipename),
-  bufsize_(bufsize),
-  hPipe_(INVALID_HANDLE_VALUE),
-  isAnonymous(false)
- {  //Restrict maxconns_ to 1-255
-    if(maxconnections == 0)
-      maxconns_ = 1;
-    else if (maxconnections > 255)
-      maxconns_ = 255;
-	else
-      maxconns_ = maxconnections;
- }
-
-TPipeServer::TPipeServer(string pipename) :
-  pipename_(pipename),
-  bufsize_(1024),
-  hPipe_(INVALID_HANDLE_VALUE),
-  isAnonymous(false),
-  maxconns_(TPIPE_SERVER_MAX_CONNS_DEFAULT)
- {}
-
-TPipeServer::TPipeServer(int bufsize) : 
-  pipename_(""),
-  bufsize_(bufsize),
-  hPipe_(INVALID_HANDLE_VALUE),
-  isAnonymous(true),
-  maxconns_(1)
- {
-  //The anonymous pipe needs to be created first so that the server can
-  //pass the handles on to the client before the serve (acceptImpl)
-  //blocking call.
-  if (!TCreateAnonPipe()) {
-    GlobalOutput.perror("TPipeServer Create(Anon)Pipe failed, GLE=", GetLastError());
-    throw TTransportException(TTransportException::NOT_OPEN, " TPipeServer Create(Anon)Pipe failed");
-  }
-}
-
-TPipeServer::TPipeServer() : 
-  pipename_(""),
-  bufsize_(1024),
-  hPipe_(INVALID_HANDLE_VALUE),
-  isAnonymous(true),
-  maxconns_(1)
-{
-  if (!TCreateAnonPipe()) {
-    GlobalOutput.perror("TPipeServer Create(Anon)Pipe failed, GLE=", GetLastError());
-    throw TTransportException(TTransportException::NOT_OPEN, " TPipeServer Create(Anon)Pipe failed");
-  }
-}
-
-//---- Destructor ----
-TPipeServer::~TPipeServer() {
-  close();
-}
-
-//---------------------------------------------------------
-// Transport callbacks
-//---------------------------------------------------------
-
-shared_ptr<TTransport> TPipeServer::acceptImpl() {
-  shared_ptr<TPipe> client;
-
-  if(isAnonymous)
-  { //Anonymous Pipe
-    //This 0-byte read serves merely as a blocking call.
-    byte buf;
-    DWORD br;
-    int fSuccess = ReadFile( 
-          hPipe_, // pipe handle 
-          &buf,   // buffer to receive reply 
-          0,      // size of buffer 
-          &br,    // number of bytes read 
-          NULL);  // not overlapped
-
-    if ( !fSuccess && GetLastError() != ERROR_MORE_DATA ) {
-      GlobalOutput.perror("TPipeServer unable to initiate pipe comms, GLE=", GetLastError());
-      throw TTransportException(TTransportException::NOT_OPEN, " TPipeServer unable to initiate pipe comms");
-    }
-	client.reset(new TPipe(hPipe_, hPipeW_));
-  }
-  else
-  { //Named Pipe
-    int ConnectRet;
-    while (true)
-    {
-      if (!TCreateNamedPipe()) {
-        GlobalOutput.perror("TPipeServer CreateNamedPipe failed, GLE=", GetLastError());
-        throw TTransportException(TTransportException::NOT_OPEN, " TPipeServer CreateNamedPipe failed");
-      }
-
-      // Wait for the client to connect; if it succeeds, the
-      // function returns a nonzero value. If the function returns 
-      // zero, GetLastError should return ERROR_PIPE_CONNECTED. 
-      ConnectRet = ConnectNamedPipe(hPipe_, NULL) ? 
-                    TRUE : (GetLastError() == ERROR_PIPE_CONNECTED);
-
-      if (ConnectRet == TRUE)
-      {
-        GlobalOutput.printf("Client connected.");
-        break;
-      }
-      else
-      {
-        close();
-        GlobalOutput.perror("TPipeServer ConnectNamedPipe GLE=", GetLastError());
-        throw TTransportException(TTransportException::NOT_OPEN, "TPipeServer: client connection failed");
-      }
-    }
-	client.reset(new TPipe(hPipe_));
-  }
-
-  return client;
-}
-
-void TPipeServer::interrupt() {
-  if(hPipe_ != INVALID_HANDLE_VALUE) {
-    CancelIo(hPipe_);
-  }
-}
-
-void TPipeServer::close() {
-  if(!isAnonymous)
-  {
-    if(hPipe_ != INVALID_HANDLE_VALUE) {
-      DisconnectNamedPipe(hPipe_);
-      CloseHandle(hPipe_);
-      hPipe_ = INVALID_HANDLE_VALUE;
-    }
-  }
-  else
-  {
-    try {
-      CloseHandle(hPipe_);
-      CloseHandle(hPipeW_);
-      CloseHandle(ClientAnonRead);
-      CloseHandle(ClientAnonWrite);
-    }
-    catch(...) {
-        GlobalOutput.perror("TPipeServer anon close GLE=", GetLastError());
-    }
-  }
-}
-
-
-bool TPipeServer::TCreateNamedPipe() {
-
-  //Windows - set security to allow non-elevated apps
-  //to access pipes created by elevated apps.
-  SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;
-  PSID everyone_sid = NULL;
-  AllocateAndInitializeSid(&SIDAuthWorld, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &everyone_sid);
-
-  EXPLICIT_ACCESS ea;
-  ZeroMemory(&ea, sizeof(EXPLICIT_ACCESS));
-  ea.grfAccessPermissions = SPECIFIC_RIGHTS_ALL | STANDARD_RIGHTS_ALL;
-  ea.grfAccessMode = SET_ACCESS;
-  ea.grfInheritance = NO_INHERITANCE;
-  ea.Trustee.TrusteeForm = TRUSTEE_IS_SID;
-  ea.Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
-  ea.Trustee.ptstrName  = (LPSTR)everyone_sid;
-
-  PACL acl = NULL;
-  SetEntriesInAcl(1, &ea, NULL, &acl);
-
-  PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR,SECURITY_DESCRIPTOR_MIN_LENGTH);
-  InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION);
-  SetSecurityDescriptorDacl(sd, TRUE, acl, FALSE);
-
-  SECURITY_ATTRIBUTES sa;
-  sa.nLength = sizeof(SECURITY_ATTRIBUTES);
-  sa.lpSecurityDescriptor = sd;
-  sa.bInheritHandle = FALSE;
-
-  // Create an instance of the named pipe
-  hPipe_ = CreateNamedPipe( 
-        pipename_.c_str(),        // pipe name 
-        PIPE_ACCESS_DUPLEX,       // read/write access 
-        PIPE_TYPE_MESSAGE |       // message type pipe 
-        PIPE_READMODE_MESSAGE,    // message-read mode 
-        maxconns_,                // max. instances  
-        bufsize_,                 // output buffer size 
-        bufsize_,                 // input buffer size 
-        0,                        // client time-out 
-        &sa);                     // default security attribute 
-
-  return (hPipe_ != INVALID_HANDLE_VALUE);
-}
-
-bool TPipeServer::TCreateAnonPipe() {
-  SECURITY_ATTRIBUTES sa;
-  SECURITY_DESCRIPTOR sd; //security information for pipes
-
-  InitializeSecurityDescriptor(&sd,SECURITY_DESCRIPTOR_REVISION);
-  SetSecurityDescriptorDacl(&sd, true, NULL, false);
-  sa.lpSecurityDescriptor = &sd;
-  sa.lpSecurityDescriptor = NULL;
-  sa.nLength = sizeof(SECURITY_ATTRIBUTES);
-  sa.bInheritHandle = true; //allow passing handle to child
-
-  if (!CreatePipe(&ClientAnonRead,&hPipeW_,&sa,0))   //create stdin pipe
-  {
-    GlobalOutput.perror("TPipeServer CreatePipe (anon) failed, GLE=", GetLastError());
-    return false;
-  }
-  if (!CreatePipe(&hPipe_,&ClientAnonWrite,&sa,0))  //create stdout pipe
-  {
-    GlobalOutput.perror("TPipeServer CreatePipe (anon) failed, GLE=", GetLastError());
-    CloseHandle(ClientAnonRead);
-    CloseHandle(hPipeW_);
-    return false;
-  }
-
-  return true;
-}
-
-
-//---------------------------------------------------------
-// Accessors
-//---------------------------------------------------------
-
-string TPipeServer::getPipename() {
-  return pipename_;
-}
-
-void TPipeServer::setPipename(std::string pipename) {
-  pipename_ = pipename;
-}
-
-int  TPipeServer::getBufferSize() {
-  return bufsize_;
-}
-
-void TPipeServer::setBufferSize(int bufsize) {
-  bufsize_ = bufsize;
-}
-
-HANDLE TPipeServer::getPipeHandle() {
-  return hPipe_;
-}
-
-HANDLE TPipeServer::getWrtPipeHandle()
-{
-  return hPipeW_;
-}
-
-HANDLE TPipeServer::getClientRdPipeHandle()
-{
-  return ClientAnonRead;
-}
-
-HANDLE TPipeServer::getClientWrtPipeHandle()
-{
-  return ClientAnonWrite;
-}
-
-bool TPipeServer::getAnonymous() {
-  return isAnonymous;
-}
-
-void TPipeServer::setAnonymous(bool anon) {
-  isAnonymous = anon;
-}
-
-}}} // apache::thrift::transport
-
-#endif //_WIN32
diff --git a/lib/cpp/src/transport/TPipeServer.h b/lib/cpp/src/transport/TPipeServer.h
deleted file mode 100644
index 1732546..0000000
--- a/lib/cpp/src/transport/TPipeServer.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_TSERVERWINPIPES_H_
-#define _THRIFT_TRANSPORT_TSERVERWINPIPES_H_ 1
-#ifdef _WIN32
-
-#include "TServerTransport.h"
-#include <boost/shared_ptr.hpp>
-
-#define TPIPE_SERVER_MAX_CONNS_DEFAULT 10
-
-namespace apache { namespace thrift { namespace transport {
-
-/**
- * Windows Pipes implementation of TServerTransport.
- */
-class TPipeServer : public TServerTransport {
- public:
-  //Constructors
-  // Named Pipe -
-  TPipeServer(std::string pipename, uint32_t bufsize);
-  TPipeServer(std::string pipename, uint32_t bufsize, uint32_t maxconnections);
-  TPipeServer(std::string pipename);
-  // Anonymous pipe -
-  TPipeServer(int bufsize);
-  TPipeServer();
-
-  //Destructor
-  ~TPipeServer();
-
-  //Standard transport callbacks
-  //void listen(); //Unnecessary for Windows pipes
-  void interrupt();
-  void close();
- protected:
-  boost::shared_ptr<TTransport> acceptImpl();
-
-  bool TCreateNamedPipe();
-  bool TCreateAnonPipe();
-
- public:
-  //Accessors
-  std::string getPipename();
-  void setPipename(std::string pipename);
-  int  getBufferSize();
-  void setBufferSize(int bufsize);
-  HANDLE getPipeHandle();  //Named Pipe R/W -or- Anonymous pipe Read handle
-  HANDLE getWrtPipeHandle();
-  HANDLE getClientRdPipeHandle();
-  HANDLE getClientWrtPipeHandle();
-  bool getAnonymous();
-  void setAnonymous(bool anon);
-
- private:
-  std::string pipename_;
-  uint32_t bufsize_;
-  uint32_t maxconns_;
-  HANDLE hPipe_;  //Named Pipe (R/W) or Anonymous Pipe (R)
-  HANDLE hPipeW_; //Anonymous Pipe (W)
-  HANDLE ClientAnonRead, ClientAnonWrite; //Client side anonymous pipe handles
-  //? Do we need duplicates to send to client?
-  bool isAnonymous;
-};
-
-}}} // apache::thrift::transport
-
-#endif //_WIN32
-#endif // #ifndef _THRIFT_TRANSPORT_TSERVERWINPIPES_H_