|
|
@ -60,6 +60,7 @@ |
|
|
|
#include "google/protobuf/port.h" |
|
|
|
#include "google/protobuf/port.h" |
|
|
|
#include "absl/base/attributes.h" |
|
|
|
#include "absl/base/attributes.h" |
|
|
|
#include "absl/log/absl_check.h" |
|
|
|
#include "absl/log/absl_check.h" |
|
|
|
|
|
|
|
#include "google/protobuf/internal_visibility.h" |
|
|
|
#include "google/protobuf/message_lite.h" |
|
|
|
#include "google/protobuf/message_lite.h" |
|
|
|
#include "google/protobuf/port.h" |
|
|
|
#include "google/protobuf/port.h" |
|
|
|
|
|
|
|
|
|
|
@ -924,9 +925,18 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
constexpr RepeatedPtrField(); |
|
|
|
constexpr RepeatedPtrField(); |
|
|
|
explicit RepeatedPtrField(Arena* arena); |
|
|
|
RepeatedPtrField(const RepeatedPtrField& other) |
|
|
|
|
|
|
|
: RepeatedPtrField(nullptr, other) {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Arena enabled constructors: for internal use only.
|
|
|
|
|
|
|
|
RepeatedPtrField(internal::InternalVisibility, Arena* arena) |
|
|
|
|
|
|
|
: RepeatedPtrField(arena) {} |
|
|
|
|
|
|
|
RepeatedPtrField(internal::InternalVisibility, Arena* arena, |
|
|
|
|
|
|
|
const RepeatedPtrField& rhs) |
|
|
|
|
|
|
|
: RepeatedPtrField(arena, rhs) {} |
|
|
|
|
|
|
|
|
|
|
|
RepeatedPtrField(const RepeatedPtrField& other); |
|
|
|
// TODO(b/290091828): make constructor private
|
|
|
|
|
|
|
|
explicit RepeatedPtrField(Arena* arena); |
|
|
|
|
|
|
|
|
|
|
|
template <typename Iter, |
|
|
|
template <typename Iter, |
|
|
|
typename = typename std::enable_if<std::is_constructible< |
|
|
|
typename = typename std::enable_if<std::is_constructible< |
|
|
@ -1214,6 +1224,8 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
|
|
|
|
RepeatedPtrField(Arena* arena, const RepeatedPtrField& rhs); |
|
|
|
|
|
|
|
|
|
|
|
// Note: RepeatedPtrField SHOULD NOT be subclassed by users.
|
|
|
|
// Note: RepeatedPtrField SHOULD NOT be subclassed by users.
|
|
|
|
class TypeHandler; |
|
|
|
class TypeHandler; |
|
|
|
|
|
|
|
|
|
|
@ -1267,11 +1279,11 @@ inline RepeatedPtrField<Element>::RepeatedPtrField(Arena* arena) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template <typename Element> |
|
|
|
template <typename Element> |
|
|
|
inline RepeatedPtrField<Element>::RepeatedPtrField( |
|
|
|
inline RepeatedPtrField<Element>::RepeatedPtrField(Arena* arena, |
|
|
|
const RepeatedPtrField& other) |
|
|
|
const RepeatedPtrField& rhs) |
|
|
|
: RepeatedPtrFieldBase() { |
|
|
|
: RepeatedPtrFieldBase(arena) { |
|
|
|
StaticValidityCheck(); |
|
|
|
StaticValidityCheck(); |
|
|
|
MergeFrom(other); |
|
|
|
MergeFrom(rhs); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template <typename Element> |
|
|
|
template <typename Element> |
|
|
|