Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:12:24

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 <cstddef>
0016 #include <cstdint>
0017 
0018 #include "absl/base/attributes.h"
0019 #include "google/protobuf/arena.h"
0020 #include "google/protobuf/generated_message_util.h"
0021 #include "google/protobuf/message.h"
0022 
0023 // Must come last:
0024 #include "google/protobuf/port_def.inc"
0025 
0026 namespace google {
0027 namespace protobuf {
0028 namespace internal {
0029 
0030 // To save code size, protos without any fields are derived from ZeroFieldsBase
0031 // rather than Message.
0032 class PROTOBUF_EXPORT ZeroFieldsBase : public Message {
0033  public:
0034   ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL { Clear(*this); }
0035   size_t ByteSizeLong() const PROTOBUF_FINAL { return ByteSizeLong(*this); }
0036   int GetCachedSize() const { return _impl_._cached_size_.Get(); }
0037   ::uint8_t* _InternalSerialize(
0038       ::uint8_t* target, io::EpsCopyOutputStream* stream) const PROTOBUF_FINAL {
0039     return _InternalSerialize(*this, target, stream);
0040   }
0041 
0042  protected:
0043   using Message::Message;
0044   ~ZeroFieldsBase() PROTOBUF_OVERRIDE;
0045 
0046   static void SharedDtor(MessageLite& msg);
0047   static void MergeImpl(MessageLite& to, const MessageLite& from);
0048   static void CopyImpl(Message& to, const Message& from);
0049   void InternalSwap(ZeroFieldsBase* other);
0050   static void Clear(MessageLite& msg);
0051   static size_t ByteSizeLong(const MessageLite& base);
0052   static ::uint8_t* _InternalSerialize(const MessageLite& msg,
0053                                        ::uint8_t* target,
0054                                        io::EpsCopyOutputStream* stream);
0055 
0056   // The following naming is required to match protobuf naming conventions.
0057   struct {
0058     internal::CachedSize _cached_size_;  // NOLINT
0059   } _impl_;                              // NOLINT
0060 };
0061 
0062 }  // namespace internal
0063 }  // namespace protobuf
0064 }  // namespace google
0065 
0066 #include "google/protobuf/port_undef.inc"
0067 
0068 #endif  // GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__