diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-03-13 18:36:39 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-03-13 18:36:39 +0100 |
commit | 613d6fe997c8744f76f23a5819f6613ec3b288c2 (patch) | |
tree | b6a4c89e370793a085d525081e3e9ec7a97c5566 | |
parent | d446eb86fae18df3c473c96676da5bcf4f69178c (diff) |
Moving ZeroCopyOutputStream to grpc++/config.h.
-rw-r--r-- | include/grpc++/config.h | 14 | ||||
-rw-r--r-- | src/compiler/config.h | 3 | ||||
-rw-r--r-- | src/cpp/proto/proto_utils.cc | 5 |
3 files changed, 16 insertions, 6 deletions
diff --git a/include/grpc++/config.h b/include/grpc++/config.h index 327ed7a549..fd7672784b 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -52,12 +52,26 @@ #define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message #endif +#ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM +#include <google/protobuf/io/zero_copy_stream.h> +#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ::google::protobuf::io::ZeroCopyOutputStream +#define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ::google::protobuf::io::ZeroCopyInputStream +#endif + + namespace grpc { typedef GRPC_CUSTOM_STRING string; namespace protobuf { + typedef GRPC_CUSTOM_MESSAGE Message; + +namespace io { +typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream; +typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream; +} // namespace io + } // namespace protobuf } // namespace grpc diff --git a/src/compiler/config.h b/src/compiler/config.h index dc8803ceab..e81de8d6c8 100644 --- a/src/compiler/config.h +++ b/src/compiler/config.h @@ -54,12 +54,10 @@ #ifndef GRPC_CUSTOM_PRINTER #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/io/printer.h> -#include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/io/zero_copy_stream_impl_lite.h> #define GRPC_CUSTOM_PRINTER ::google::protobuf::io::Printer #define GRPC_CUSTOM_CODEDOUTPUTSTREAM ::google::protobuf::io::CodedOutputStream #define GRPC_CUSTOM_STRINGOUTPUTSTREAM ::google::protobuf::io::StringOutputStream -#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ::google::protobuf::io::ZeroCopyOutputStream #endif #ifndef GRPC_CUSTOM_PLUGINMAIN @@ -85,7 +83,6 @@ namespace io { typedef GRPC_CUSTOM_PRINTER Printer; typedef GRPC_CUSTOM_CODEDOUTPUTSTREAM CodedOutputStream; typedef GRPC_CUSTOM_STRINGOUTPUTSTREAM StringOutputStream; -typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream; } // namespace io } // namespace protobuf } // namespace grpc diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc index e4e51bfebf..acd204bf9b 100644 --- a/src/cpp/proto/proto_utils.cc +++ b/src/cpp/proto/proto_utils.cc @@ -39,12 +39,11 @@ #include <grpc/support/slice.h> #include <grpc/support/slice_buffer.h> #include <grpc/support/port_platform.h> -#include <google/protobuf/io/zero_copy_stream.h> const int kMaxBufferLength = 8192; class GrpcBufferWriter GRPC_FINAL - : public ::google::protobuf::io::ZeroCopyOutputStream { + : public ::grpc::protobuf::io::ZeroCopyOutputStream { public: explicit GrpcBufferWriter(grpc_byte_buffer **bp, int block_size = kMaxBufferLength) @@ -97,7 +96,7 @@ class GrpcBufferWriter GRPC_FINAL }; class GrpcBufferReader GRPC_FINAL - : public ::google::protobuf::io::ZeroCopyInputStream { + : public ::grpc::protobuf::io::ZeroCopyInputStream { public: explicit GrpcBufferReader(grpc_byte_buffer *buffer) : byte_count_(0), backup_count_(0) { |