aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/support/byte_buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++/support/byte_buffer.h')
-rw-r--r--include/grpc++/support/byte_buffer.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/grpc++/support/byte_buffer.h b/include/grpc++/support/byte_buffer.h
index 9d19b07708..82591a88ef 100644
--- a/include/grpc++/support/byte_buffer.h
+++ b/include/grpc++/support/byte_buffer.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,8 +55,14 @@ class ByteBuffer GRPC_FINAL {
/// Construct buffer from \a slices, of which there are \a nslices.
ByteBuffer(const Slice* slices, size_t nslices);
+ /// Constuct a byte buffer by referencing elements of existing buffer
+ /// \a buf. Wrapper of core function grpc_byte_buffer_copy
+ ByteBuffer(const ByteBuffer& buf);
+
~ByteBuffer();
+ ByteBuffer& operator=(const ByteBuffer&);
+
/// Dump (read) the buffer contents into \a slices.
void Dump(std::vector<Slice>* slices) const;
@@ -69,9 +75,6 @@ class ByteBuffer GRPC_FINAL {
private:
friend class SerializationTraits<ByteBuffer, void>;
- ByteBuffer(const ByteBuffer&);
- ByteBuffer& operator=(const ByteBuffer&);
-
// takes ownership
void set_buffer(grpc_byte_buffer* buf) {
if (buffer_) {