Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:12:20

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 Google Inc.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 // This file contains helpers for generated code.
0009 //
0010 //  Nothing in this file should be directly referenced by users of protobufs.
0011 
0012 #ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__
0013 #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__
0014 
0015 #include "google/protobuf/arena.h"
0016 #include "google/protobuf/generated_message_util.h"
0017 #include "google/protobuf/io/zero_copy_stream_impl.h"
0018 #include "google/protobuf/message.h"
0019 #include "google/protobuf/parse_context.h"
0020 
0021 // Must come last:
0022 #include "google/protobuf/port_def.inc"
0023 
0024 namespace google {
0025 namespace protobuf {
0026 namespace internal {
0027 
0028 // To save code size, protos without any fields are derived from ZeroFieldsBase
0029 // rather than Message.
0030 class PROTOBUF_EXPORT ZeroFieldsBase : public Message {
0031  public:
0032   ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL { Clear(*this); }
0033   size_t ByteSizeLong() const PROTOBUF_FINAL { return ByteSizeLong(*this); }
0034   int GetCachedSize() const { return _impl_._cached_size_.Get(); }
0035   ::uint8_t* _InternalSerialize(
0036       ::uint8_t* target, io::EpsCopyOutputStream* stream) const PROTOBUF_FINAL {
0037     return _InternalSerialize(*this, target, stream);
0038   }
0039 
0040  protected:
0041   using Message::Message;
0042   ~ZeroFieldsBase() PROTOBUF_OVERRIDE;
0043 
0044   static void MergeImpl(MessageLite& to, const MessageLite& from);
0045   static void CopyImpl(Message& to, const Message& from);
0046   void InternalSwap(ZeroFieldsBase* other);
0047   static void Clear(MessageLite& msg);
0048   static size_t ByteSizeLong(const MessageLite& msg);
0049   static ::uint8_t* _InternalSerialize(const MessageLite& msg,
0050                                        ::uint8_t* target,
0051                                        io::EpsCopyOutputStream* stream);
0052 
0053   struct {
0054     mutable internal::CachedSize _cached_size_;
0055   } _impl_;
0056 };
0057 
0058 }  // namespace internal
0059 }  // namespace protobuf
0060 }  // namespace google
0061 
0062 #include "google/protobuf/port_undef.inc"
0063 
0064 #endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__