aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/implicit_weak_message.h
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2018-08-08 17:00:41 -0700
committerFeng Xiao <xfxyjwf@gmail.com>2018-08-08 17:00:41 -0700
commit6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3 (patch)
treee575738adf52d24b883cca5e8928a5ded31caba1 /src/google/protobuf/implicit_weak_message.h
parente7746f487cb9cca685ffb1b3d7dccc5554b618a4 (diff)
downloadprotobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.gz
protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.bz2
protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.zip
Down-integrate from google3.
Diffstat (limited to 'src/google/protobuf/implicit_weak_message.h')
-rw-r--r--src/google/protobuf/implicit_weak_message.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/google/protobuf/implicit_weak_message.h b/src/google/protobuf/implicit_weak_message.h
index 3279bd17..29836289 100644
--- a/src/google/protobuf/implicit_weak_message.h
+++ b/src/google/protobuf/implicit_weak_message.h
@@ -31,10 +31,15 @@
#ifndef GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__
#define GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__
+#include <string>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/message_lite.h>
+#ifdef SWIG
+#error "You cannot SWIG proto headers"
+#endif
+
// This file is logically internal-only and should only be used by protobuf
// generated code.
@@ -71,6 +76,13 @@ class LIBPROTOBUF_EXPORT ImplicitWeakMessage : public MessageLite {
bool MergePartialFromCodedStream(io::CodedInputStream* input);
+#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
+ ParseFunc _ParseFunc() const { return _InternalParse; }
+
+ static const char* _InternalParse(const char* begin, const char* end,
+ void* object, ParseContext* ctx);
+#endif
+
size_t ByteSizeLong() const { return data_.size(); }
void SerializeWithCachedSizes(io::CodedOutputStream* output) const {
@@ -92,7 +104,7 @@ template <typename ImplicitWeakType>
class ImplicitWeakTypeHandler {
public:
typedef ImplicitWeakType Type;
- typedef ::google::protobuf::MessageLite WeakType;
+ typedef MessageLite WeakType;
static const bool Moveable = false;
// With implicit weak fields, we need separate NewFromPrototype and
@@ -100,27 +112,24 @@ class ImplicitWeakTypeHandler {
// strong dependency on the message type, and it just delegates to the
// GenericTypeHandler. The latter avoids creating a strong dependency, by
// simply calling MessageLite::New.
- static inline ::google::protobuf::MessageLite* NewFromPrototype(
- const ::google::protobuf::MessageLite* prototype, ::google::protobuf::Arena* arena = NULL) {
+ static inline MessageLite* NewFromPrototype(const MessageLite* prototype,
+ Arena* arena = NULL) {
return prototype->New(arena);
}
- static inline void Delete(::google::protobuf::MessageLite* value, Arena* arena) {
+ static inline void Delete(MessageLite* value, Arena* arena) {
if (arena == NULL) {
delete value;
}
}
- static inline ::google::protobuf::Arena* GetArena(::google::protobuf::MessageLite* value) {
+ static inline Arena* GetArena(MessageLite* value) {
return value->GetArena();
}
- static inline void* GetMaybeArenaPointer(::google::protobuf::MessageLite* value) {
+ static inline void* GetMaybeArenaPointer(MessageLite* value) {
return value->GetArena();
}
- static inline void Clear(::google::protobuf::MessageLite* value) {
- value->Clear();
- }
- static void Merge(const ::google::protobuf::MessageLite& from,
- ::google::protobuf::MessageLite* to) {
+ static inline void Clear(MessageLite* value) { value->Clear(); }
+ static void Merge(const MessageLite& from, MessageLite* to) {
to->CheckTypeAndMergeFrom(from);
}
static inline size_t SpaceUsedLong(const Type& value) {
@@ -130,6 +139,6 @@ class ImplicitWeakTypeHandler {
} // namespace internal
} // namespace protobuf
-
} // namespace google
+
#endif // GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__