aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/dynamic_message.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/dynamic_message.cc')
-rw-r--r--src/google/protobuf/dynamic_message.cc25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/google/protobuf/dynamic_message.cc b/src/google/protobuf/dynamic_message.cc
index 48d6aad8..8ad112ce 100644
--- a/src/google/protobuf/dynamic_message.cc
+++ b/src/google/protobuf/dynamic_message.cc
@@ -65,9 +65,6 @@
#include <algorithm>
#include <google/protobuf/stubs/hash.h>
#include <memory>
-#ifndef _SHARED_PTR_H
-#include <google/protobuf/stubs/shared_ptr.h>
-#endif
#include <google/protobuf/stubs/common.h>
@@ -232,13 +229,13 @@ class DynamicMessage : public Message {
// Warning: The order in which the following pointers are defined is
// important (the prototype must be deleted *before* the offsets).
- google::protobuf::scoped_array<uint32> offsets;
- google::protobuf::scoped_array<uint32> has_bits_indices;
- google::protobuf::scoped_ptr<const GeneratedMessageReflection> reflection;
- // Don't use a scoped_ptr to hold the prototype: the destructor for
+ std::unique_ptr<uint32[]> offsets;
+ std::unique_ptr<uint32[]> has_bits_indices;
+ std::unique_ptr<const GeneratedMessageReflection> reflection;
+ // Don't use a unique_ptr to hold the prototype: the destructor for
// DynamicMessage needs to know whether it is the prototype, and does so by
// looking back at this field. This would assume details about the
- // implementation of scoped_ptr.
+ // implementation of unique_ptr.
const DynamicMessage* prototype;
int weak_field_map_offset; // The offset for the weak_field_map;
@@ -261,14 +258,14 @@ class DynamicMessage : public Message {
// implements Message ----------------------------------------------
- Message* New() const;
- Message* New(::google::protobuf::Arena* arena) const;
- ::google::protobuf::Arena* GetArena() const { return arena_; }
+ Message* New() const override;
+ Message* New(::google::protobuf::Arena* arena) const override;
+ ::google::protobuf::Arena* GetArena() const override { return arena_; }
- int GetCachedSize() const;
- void SetCachedSize(int size) const;
+ int GetCachedSize() const override;
+ void SetCachedSize(int size) const override;
- Metadata GetMetadata() const;
+ Metadata GetMetadata() const override;
// We actually allocate more memory than sizeof(*this) when this
// class's memory is allocated via the global operator new. Thus, we need to