Moving ZeroCopyOutputStream to grpc++/config.h.

pull/1032/head
Nicolas "Pixel" Noble 10 years ago
parent d446eb86fa
commit 613d6fe997
  1. 14
      include/grpc++/config.h
  2. 3
      src/compiler/config.h
  3. 5
      src/cpp/proto/proto_utils.cc

@ -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

@ -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

@ -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) {

Loading…
Cancel
Save