Go to the documentation of this file.
110 #ifndef GOOGLE_PROTOBUF_MESSAGE_H__
111 #define GOOGLE_PROTOBUF_MESSAGE_H__
115 #include <type_traits>
118 #include <google/protobuf/stubs/casts.h>
119 #include <google/protobuf/stubs/common.h>
120 #include <google/protobuf/arena.h>
121 #include <google/protobuf/descriptor.h>
122 #include <google/protobuf/generated_message_reflection.h>
123 #include <google/protobuf/message_lite.h>
124 #include <google/protobuf/port.h>
127 #define GOOGLE_PROTOBUF_HAS_ONEOF
128 #define GOOGLE_PROTOBUF_HAS_ARENAS
130 #include <google/protobuf/port_def.inc>
133 #error "You cannot SWIG proto headers"
142 class MessageFactory;
145 class AssignDescriptorsHelper;
150 class MapReflectionTester;
153 struct DescriptorTable;
164 class MapReflectionFriend;
167 class CelMapReflectionFriend;
171 class MapFieldPrinterHelper;
176 class ReflectionAccessor;
180 class MapFieldReflectionTest;
183 template <
typename T>
186 template <
typename T>
222 if (
arena !=
nullptr) {
242 void CheckInitialized()
const;
252 std::string InitializationErrorString()
const override;
274 virtual size_t SpaceUsedLong()
const;
276 PROTOBUF_DEPRECATED_MSG(
"Please use SpaceUsedLong() instead")
289 void PrintDebugString()
const;
296 void Clear()
override;
298 void CheckTypeAndMergeFrom(
const MessageLite& other)
override;
302 size_t ByteSizeLong()
const override;
303 uint8* InternalSerializeWithCachedSizesToArray(
314 virtual void SetCachedSize(
int size)
const;
338 virtual Metadata GetMetadata()
const = 0;
348 class RepeatedFieldAccessor;
353 template <
typename T,
typename Enable =
void>
356 template <
typename T,
typename Enable =
void>
411 PROTOBUF_DEPRECATED_MSG(
"Please use SpaceUsedLong() instead")
455 const std::vector<const FieldDescriptor*>&
fields)
const;
470 std::vector<const FieldDescriptor*>*
output)
const;
721 template <
typename T>
727 template <
typename T>
748 template <
typename T>
749 PROTOBUF_DEPRECATED_MSG(
"Please use GetRepeatedFieldRef() instead")
757 PROTOBUF_DEPRECATED_MSG("Please use GetMutableRepeatedFieldRef() instead")
766 PROTOBUF_DEPRECATED_MSG("Please use GetRepeatedFieldRef() instead")
775 PROTOBUF_DEPRECATED_MSG("Please use GetMutableRepeatedFieldRef() instead")
783 PROTOBUF_DEPRECATED_MSG(
784 "Please use
DescriptorPool::FindExtensionByPrintableName instead")
790 PROTOBUF_DEPRECATED_MSG(
824 bool SupportsUnknownEnumValues()
const;
872 const internal::RepeatedFieldAccessor* RepeatedFieldAccessor(
883 int last_non_weak_field_index_;
889 friend class ::PROTOBUF_NAMESPACE_ID::MessageLayoutInspector;
892 friend class python::MapReflectionFriend;
893 #define GOOGLE_PROTOBUF_HAS_CEL_MAP_REFLECTION_FRIEND
894 friend class expr::CelMapReflectionFriend;
914 bool is_string)
const;
960 template <
typename Type>
963 template <
typename Type>
965 template <
typename Type>
972 inline uint32* MutableOneofCase(
1009 template <
typename Type>
1012 template <
typename Type>
1015 template <
typename Type>
1018 template <
typename Type>
1022 template <
typename Type>
1026 template <
typename Type>
1029 template <
typename Type>
1033 template <
typename Type>
1036 template <
typename Type>
1115 static void InternalRegisterGeneratedFile(
1129 #define DECLARE_GET_REPEATED_FIELD(TYPE) \
1131 PROTOBUF_EXPORT const RepeatedField<TYPE>& \
1132 Reflection::GetRepeatedField<TYPE>(const Message& message, \
1133 const FieldDescriptor* field) const; \
1136 PROTOBUF_EXPORT RepeatedField<TYPE>* Reflection::MutableRepeatedField<TYPE>( \
1137 Message * message, const FieldDescriptor* field) const;
1147 #undef DECLARE_GET_REPEATED_FIELD
1156 template <
typename T>
1160 const T& (*get_default_instance)() = &T::default_instance;
1161 (void)get_default_instance;
1164 const Message* unused =
static_cast<T*
>(
nullptr);
1167 #ifdef GOOGLE_PROTOBUF_NO_RTTI
1168 bool ok = T::default_instance().GetReflection() ==
from->GetReflection();
1169 return ok ? down_cast<const T*>(
from) :
nullptr;
1171 return dynamic_cast<const T*
>(
from);
1175 template <
typename T>
1178 return const_cast<T*
>(DynamicCastToGenerated<T>(message_const));
1201 template <
typename T>
1214 inline const RepeatedPtrField<std::string>&
1215 Reflection::GetRepeatedPtrField<std::string>(
1222 inline RepeatedPtrField<std::string>*
1223 Reflection::MutableRepeatedPtrField<std::string>(
1246 template <
typename PB>
1254 template <
typename PB>
1257 return static_cast<RepeatedPtrField<PB>*
>(
1264 #include <google/protobuf/port_undef.inc>
1266 #endif // GOOGLE_PROTOBUF_MESSAGE_H__
void Swap(T &lhs, T &rhs) noexcept(IsNothrowSwappable< T >::value)
Arena * GetArena(MessageLite *msg, int64 arena_offset)
const Descriptor::ReservedRange value
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream
const Reflection * GetReflection() const
static PyObject * CopyFrom(CMessage *self, PyObject *arg)
std::string DebugString(const google::protobuf::Message &message)
GRPC_CUSTOM_DYNAMICMESSAGEFACTORY DynamicMessageFactory
GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream
std::string GetTypeName()
ExtensionSet * GetExtensionSet(MessageLite *msg, int64 extension_offset)
static PyObject * UnknownFieldSet(CMessage *self)
#define T(upbtypeconst, upbtype, ctype, default_value)
grpc_core::ScopedArenaPtr arena
void SetField(uint64 val, const FieldDescriptor *field, Message *msg, const Reflection *reflection)
Message * New(Arena *arena) const override
static PyObject * AddMessage(RepeatedCompositeContainer *self, PyObject *value)
static PyObject * FindExtensionByNumber(PyObject *self, PyObject *args)
int ToIntSize(size_t size)
void LinkMessageReflection()
GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream
T ClearBit(T *i, size_t n)
const void * GetRawRepeatedField(const Message &message, const FieldDescriptor *field, FieldDescriptor::CppType cpptype, int ctype, const Descriptor *message_type) const
GRPC_CUSTOM_CODEDOUTPUTSTREAM CodedOutputStream
const RepeatedPtrField< T > & GetRepeatedPtrField(const Message &, const FieldDescriptor *) const
FieldDescriptorProto * AddField(DescriptorProto *parent, const std::string &name, int number, FieldDescriptorProto::Label label, FieldDescriptorProto::Type type)
Type * MutableField(MessageLite *msg, uint32 *has_bits, uint32 has_bit_index, int64 offset)
void * MutableRawRepeatedField(Message *message, const FieldDescriptor *field, FieldDescriptor::CppType, int ctype, const Descriptor *message_type) const
static bool GetString(std::string *out, CBS *cbs)
const FieldDescriptor * field
const Descriptor * GetDescriptor() const
const T * DynamicCastToGenerated(const Message *from)
void RegisterAllTypesInternal(const Metadata *file_level_metadata, int size)
EnumDescriptorProto * AddEnum(FileDescriptorProto *file, const std::string &name)
void StrongReference(const T &var)
InternalDescriptorPool * pool
void ClearOneofField(const ParseTableField &field, Arena *arena, MessageLite *msg)
EnumValueDescriptorProto * AddEnumValue(EnumDescriptorProto *enum_proto, const std::string &name, int number)
#define DECLARE_GET_REPEATED_FIELD(TYPE)
static const char descriptor[1336]
static ParentDescriptor GetDescriptor(PyContainer *self)
FieldDescriptor::CppType cpp_type(FieldType type)
RepeatedPtrField< T > * MutableRepeatedPtrField(Message *, const FieldDescriptor *) const
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:25