protobuf/objectivec/GPBMessage_PackagePrivate.h
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // This header is private to the ProtobolBuffers library and must NOT be
32 // included by any sources outside this library. The contents of this file are
33 // subject to change at any time without notice.
34 
35 #import "GPBMessage.h"
36 
37 // TODO: Remove this import. Older generated code use the OSAtomic* apis,
38 // so anyone that hasn't regenerated says building by having this. After
39 // enough time has passed, this likely can be removed as folks should have
40 // regenerated.
41 #import <libkern/OSAtomic.h>
42 
43 #import "GPBBootstrap.h"
44 
45 typedef struct GPBMessage_Storage {
48 
50 
51 @interface GPBMessage () {
52  @package
53  // NOTE: Because of the +allocWithZone code using NSAllocateObject(),
54  // this structure should ideally always be kept pointer aligned where the
55  // real storage starts is also pointer aligned. The compiler/runtime already
56  // do this, but it may not be documented.
57 
58  // A pointer to the actual fields of the subclasses. The actual structure
59  // pointed to by this pointer will depend on the subclass.
60  // All of the actual structures will start the same as
61  // GPBMessage_Storage with _has_storage__ as the first field.
62  // Kept public because static functions need to access it.
63  GPBMessage_StoragePtr messageStorage_;
64 }
65 
66 // Gets an extension value without autocreating the result if not found. (i.e.
67 // returns nil if the extension is not set)
68 - (id)getExistingExtension:(GPBExtensionDescriptor *)extension;
69 
70 // Parses a message of this type from the input and merges it with this
71 // message.
72 //
73 // Warning: This does not verify that all required fields are present in
74 // the input message.
75 // Note: The caller should call
76 // -[CodedInputStream checkLastTagWas:] after calling this to
77 // verify that the last tag seen was the appropriate end-group tag,
78 // or zero for EOF.
79 // NOTE: This will throw if there is an error while parsing.
80 - (void)mergeFromCodedInputStream:(GPBCodedInputStream *)input
81  extensionRegistry:(GPBExtensionRegistry *)extensionRegistry;
82 
83 // Parses the next delimited message of this type from the input and merges it
84 // with this message.
85 - (void)mergeDelimitedFromCodedInputStream:(GPBCodedInputStream *)input
86  extensionRegistry:
87  (GPBExtensionRegistry *)extensionRegistry;
88 
89 - (void)addUnknownMapEntry:(int32_t)fieldNum value:(NSData *)data;
90 
91 @end
92 
93 CF_EXTERN_C_BEGIN
94 
95 
96 // Call this before using the readOnlySemaphore_. This ensures it is created only once.
98 
99 // Returns a new instance that was automatically created by |autocreator| for
100 // its field |field|.
102  GPBMessage *autocreator,
104  __attribute__((ns_returns_retained));
105 
106 // Returns whether |message| autocreated this message. This is NO if the message
107 // was not autocreated by |message| or if it has been mutated since
108 // autocreation.
110 
111 // Call this when you mutate a message. It will cause the message to become
112 // visible to its autocreator.
114 
115 // Call this when an array/dictionary is mutated so the parent message that
116 // autocreated it can react.
119 
120 // Clear the autocreator, if any. Asserts if the autocreator still has an
121 // autocreated reference to this message.
123 
124 CF_EXTERN_C_END
google::protobuf::extension
const Descriptor::ReservedRange const EnumValueDescriptor const MethodDescriptor extension
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:2001
+[GPBMessage message]
instancetype message()
GPBMessage_Storage
Definition: bloaty/third_party/protobuf/objectivec/GPBMessage_PackagePrivate.h:45
GPBExtensionRegistry
Definition: bloaty/third_party/protobuf/objectivec/GPBExtensionRegistry.h:57
GPBMessage_Storage
struct GPBMessage_Storage GPBMessage_Storage
-[GPBMessage data]
nullable NSData * data()
BOOL
int BOOL
Definition: undname.c:46
GPBBecomeVisibleToAutocreator
void GPBBecomeVisibleToAutocreator(GPBMessage *self)
GPBAutocreatedArrayModified
void GPBAutocreatedArrayModified(GPBMessage *self, id array)
GPBPrepareReadOnlySemaphore
CF_EXTERN_C_BEGIN void GPBPrepareReadOnlySemaphore(GPBMessage *self)
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
array
Definition: undname.c:101
__attribute__
__attribute__(void) start
GPBWasMessageAutocreatedBy
BOOL GPBWasMessageAutocreatedBy(GPBMessage *message, GPBMessage *parent)
GPBCreateMessageWithAutocreator
GPBMessage * GPBCreateMessageWithAutocreator(Class msgClass, GPBMessage *autocreator, GPBFieldDescriptor *field) __attribute__((ns_returns_retained))
value
const char * value
Definition: hpack_parser_table.cc:165
GPBAutocreatedDictionaryModified
void GPBAutocreatedDictionaryModified(GPBMessage *self, id dictionary)
GPBMessage_Storage::_has_storage_
uint32_t _has_storage_[0]
Definition: bloaty/third_party/protobuf/objectivec/GPBMessage_PackagePrivate.h:46
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
GPBFieldDescriptor
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:167
GPBClearMessageAutocreator
void GPBClearMessageAutocreator(GPBMessage *self)
GPBMessage_StoragePtr
struct GPBMessage_Storage * GPBMessage_StoragePtr
Definition: protobuf/objectivec/GPBMessage_PackagePrivate.h:49
GPBExtensionDescriptor
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:296
GPBMessage
Definition: bloaty/third_party/protobuf/objectivec/GPBMessage.h:83
GPBBootstrap.h
input
std::string input
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:197
dictionary
static const char dictionary[]
Definition: bloaty/third_party/zlib/test/example.c:34
GPBCodedInputStream
Definition: bloaty/third_party/protobuf/objectivec/GPBCodedInputStream.h:85
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
id
uint32_t id
Definition: flow_control_fuzzer.cc:70
GPBMessage.h


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:44