aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/slice.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++/slice.h')
-rw-r--r--include/grpc++/slice.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/include/grpc++/slice.h b/include/grpc++/slice.h
index f1cb76ca80..11b6a28d4f 100644
--- a/include/grpc++/slice.h
+++ b/include/grpc++/slice.h
@@ -31,15 +31,15 @@
*
*/
-#ifndef __GRPCPP_SLICE_H_
-#define __GRPCPP_SLICE_H_
+#ifndef GRPCXX_SLICE_H
+#define GRPCXX_SLICE_H
-#include <grpc++/stream.h>
-#include <grpc/slice.h>
+#include <grpc/support/slice.h>
+#include <grpc++/config.h>
namespace grpc {
-class Slice {
+class Slice GRPC_FINAL {
public:
// construct empty slice
Slice();
@@ -54,16 +54,21 @@ class Slice {
// copy constructor - adds a ref
Slice(const Slice& other);
// assignment
- Slice& operator=(Slice other) { std::swap(slice_, other.slice_); }
+ Slice& operator=(Slice other) {
+ std::swap(slice_, other.slice_);
+ return *this;
+ }
size_t size() const { return GPR_SLICE_LENGTH(slice_); }
const gpr_uint8* begin() const { return GPR_SLICE_START_PTR(slice_); }
const gpr_uint8* end() const { return GPR_SLICE_END_PTR(slice_); }
private:
+ friend class ByteBuffer;
+
gpr_slice slice_;
};
-} // namespace grpc
+} // namespace grpc
-#endif
+#endif // GRPCXX_SLICE_H