Memory-based transport rewrite.
authorDavid Reiss <dreiss@apache.org>
Thu, 1 May 2008 06:17:36 +0000 (06:17 +0000)
committerDavid Reiss <dreiss@apache.org>
Thu, 1 May 2008 06:17:36 +0000 (06:17 +0000)
commit28f298dd5d9b68c9c0dbaefa95c88d51ed8e430a
tree4c089343bfd96f8eddb653ec2f746a27d7a8ec9a
parent9a4edfa07fe0c09865015a15d26695823cd4a5fd
Memory-based transport rewrite.

The old implementations of the memory-based transports (TBufferedTransport,
TFramedTransport, and TMemoryBuffer) shared very little code and all worked
a bit differently.  This change unifies them all as subclasses of a single
base (TBufferBase) which handles the fast-path operations (when requests
can be satisfied by the buffer) with inline methods (that will eventually
be made nonvirtual in the template branch) and calls out to pure-virutal
methods to handle full/empty buffers.  All of the buffer-management is now
done in terms of "base and bound" pointers rather than "pos" integers.

These classes were moved to TBufferTransports.{h,cpp}.  The .h is included
in TTransportUtils for backwards compatibility.

Also added a "TShortReadTransport" to assist testing transports.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665676 13f79535-47bb-0310-9956-ffa450edef68
23 files changed:
compiler/cpp/src/generate/t_cpp_generator.cc
contrib/thrift_dump.cpp
lib/cpp/Makefile.am
lib/cpp/src/processor/PeekProcessor.h
lib/cpp/src/protocol/TDebugProtocol.h
lib/cpp/src/protocol/TJSONProtocol.h
lib/cpp/src/server/TNonblockingServer.h
lib/cpp/src/transport/TBufferTransports.cpp [new file with mode: 0644]
lib/cpp/src/transport/TBufferTransports.h [new file with mode: 0644]
lib/cpp/src/transport/THttpClient.cpp
lib/cpp/src/transport/THttpClient.h
lib/cpp/src/transport/TShortReadTransport.h [new file with mode: 0644]
lib/cpp/src/transport/TTransportUtils.cpp
lib/cpp/src/transport/TTransportUtils.h
test/Benchmark.cpp
test/DenseProtoTest.cpp
test/JSONProtoTest.cpp
test/Makefile.am
test/OptionalRequiredTest.cpp
test/TBufferBaseTest.cpp [new file with mode: 0644]
test/TMemoryBufferTest.cpp
test/TPipedTransportTest.cpp
test/ZlibTest.cpp