-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathTransaction.pbobjc.m
350 lines (308 loc) · 13.2 KB
/
Transaction.pbobjc.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: transaction.proto
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#import "Transaction.pbobjc.h"
#import "Commands.pbobjc.h"
#import "Primitive.pbobjc.h"
// @@protoc_insertion_point(imports)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wdirect-ivar-access"
#pragma mark - TransactionRoot
@implementation TransactionRoot
// No extensions in the file and none of the imports (direct or indirect)
// defined extensions, so no need to generate +extensionRegistry.
@end
#pragma mark - TransactionRoot_FileDescriptor
static GPBFileDescriptor *TransactionRoot_FileDescriptor(void) {
// This is called by +initialize so there is no need to worry
// about thread safety of the singleton.
static GPBFileDescriptor *descriptor = NULL;
if (!descriptor) {
GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"iroha.protocol"
syntax:GPBFileSyntaxProto3];
}
return descriptor;
}
#pragma mark - Transaction
@implementation Transaction
@dynamic hasPayload, payload;
@dynamic signaturesArray, signaturesArray_Count;
typedef struct Transaction__storage_ {
uint32_t _has_storage_[1];
Transaction_Payload *payload;
NSMutableArray *signaturesArray;
} Transaction__storage_;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = nil;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "payload",
.dataTypeSpecific.className = GPBStringifySymbol(Transaction_Payload),
.number = Transaction_FieldNumber_Payload,
.hasIndex = 0,
.offset = (uint32_t)offsetof(Transaction__storage_, payload),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeMessage,
},
{
.name = "signaturesArray",
.dataTypeSpecific.className = GPBStringifySymbol(Signature),
.number = Transaction_FieldNumber_SignaturesArray,
.hasIndex = GPBNoHasBit,
.offset = (uint32_t)offsetof(Transaction__storage_, signaturesArray),
.flags = GPBFieldRepeated,
.dataType = GPBDataTypeMessage,
},
};
GPBDescriptor *localDescriptor =
[GPBDescriptor allocDescriptorForClass:[Transaction class]
rootClass:[TransactionRoot class]
file:TransactionRoot_FileDescriptor()
fields:fields
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
storageSize:sizeof(Transaction__storage_)
flags:GPBDescriptorInitializationFlag_None];
NSAssert(descriptor == nil, @"Startup recursed!");
descriptor = localDescriptor;
}
return descriptor;
}
@end
#pragma mark - Transaction_Payload
@implementation Transaction_Payload
@dynamic optionalBatchMetaOneOfCase;
@dynamic hasReducedPayload, reducedPayload;
@dynamic batch;
typedef struct Transaction_Payload__storage_ {
uint32_t _has_storage_[2];
Transaction_Payload_ReducedPayload *reducedPayload;
Transaction_Payload_BatchMeta *batch;
} Transaction_Payload__storage_;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = nil;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "reducedPayload",
.dataTypeSpecific.className = GPBStringifySymbol(Transaction_Payload_ReducedPayload),
.number = Transaction_Payload_FieldNumber_ReducedPayload,
.hasIndex = 0,
.offset = (uint32_t)offsetof(Transaction_Payload__storage_, reducedPayload),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeMessage,
},
{
.name = "batch",
.dataTypeSpecific.className = GPBStringifySymbol(Transaction_Payload_BatchMeta),
.number = Transaction_Payload_FieldNumber_Batch,
.hasIndex = -1,
.offset = (uint32_t)offsetof(Transaction_Payload__storage_, batch),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeMessage,
},
};
GPBDescriptor *localDescriptor =
[GPBDescriptor allocDescriptorForClass:[Transaction_Payload class]
rootClass:[TransactionRoot class]
file:TransactionRoot_FileDescriptor()
fields:fields
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
storageSize:sizeof(Transaction_Payload__storage_)
flags:GPBDescriptorInitializationFlag_None];
static const char *oneofs[] = {
"optionalBatchMeta",
};
[localDescriptor setupOneofs:oneofs
count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
firstHasIndex:-1];
[localDescriptor setupContainingMessageClassName:GPBStringifySymbol(Transaction)];
NSAssert(descriptor == nil, @"Startup recursed!");
descriptor = localDescriptor;
}
return descriptor;
}
@end
void Transaction_Payload_ClearOptionalBatchMetaOneOfCase(Transaction_Payload *message) {
GPBDescriptor *descriptor = [message descriptor];
GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
GPBMaybeClearOneof(message, oneof, -1, 0);
}
#pragma mark - Transaction_Payload_BatchMeta
@implementation Transaction_Payload_BatchMeta
@dynamic type;
@dynamic reducedHashesArray, reducedHashesArray_Count;
typedef struct Transaction_Payload_BatchMeta__storage_ {
uint32_t _has_storage_[1];
Transaction_Payload_BatchMeta_BatchType type;
NSMutableArray *reducedHashesArray;
} Transaction_Payload_BatchMeta__storage_;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = nil;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "type",
.dataTypeSpecific.enumDescFunc = Transaction_Payload_BatchMeta_BatchType_EnumDescriptor,
.number = Transaction_Payload_BatchMeta_FieldNumber_Type,
.hasIndex = 0,
.offset = (uint32_t)offsetof(Transaction_Payload_BatchMeta__storage_, type),
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor),
.dataType = GPBDataTypeEnum,
},
{
.name = "reducedHashesArray",
.dataTypeSpecific.className = NULL,
.number = Transaction_Payload_BatchMeta_FieldNumber_ReducedHashesArray,
.hasIndex = GPBNoHasBit,
.offset = (uint32_t)offsetof(Transaction_Payload_BatchMeta__storage_, reducedHashesArray),
.flags = GPBFieldRepeated,
.dataType = GPBDataTypeString,
},
};
GPBDescriptor *localDescriptor =
[GPBDescriptor allocDescriptorForClass:[Transaction_Payload_BatchMeta class]
rootClass:[TransactionRoot class]
file:TransactionRoot_FileDescriptor()
fields:fields
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
storageSize:sizeof(Transaction_Payload_BatchMeta__storage_)
flags:GPBDescriptorInitializationFlag_None];
[localDescriptor setupContainingMessageClassName:GPBStringifySymbol(Transaction_Payload)];
NSAssert(descriptor == nil, @"Startup recursed!");
descriptor = localDescriptor;
}
return descriptor;
}
@end
int32_t Transaction_Payload_BatchMeta_Type_RawValue(Transaction_Payload_BatchMeta *message) {
GPBDescriptor *descriptor = [Transaction_Payload_BatchMeta descriptor];
GPBFieldDescriptor *field = [descriptor fieldWithNumber:Transaction_Payload_BatchMeta_FieldNumber_Type];
return GPBGetMessageInt32Field(message, field);
}
void SetTransaction_Payload_BatchMeta_Type_RawValue(Transaction_Payload_BatchMeta *message, int32_t value) {
GPBDescriptor *descriptor = [Transaction_Payload_BatchMeta descriptor];
GPBFieldDescriptor *field = [descriptor fieldWithNumber:Transaction_Payload_BatchMeta_FieldNumber_Type];
GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
}
#pragma mark - Enum Transaction_Payload_BatchMeta_BatchType
GPBEnumDescriptor *Transaction_Payload_BatchMeta_BatchType_EnumDescriptor(void) {
static GPBEnumDescriptor *descriptor = NULL;
if (!descriptor) {
static const char *valueNames =
"Atomic\000Ordered\000";
static const int32_t values[] = {
Transaction_Payload_BatchMeta_BatchType_Atomic,
Transaction_Payload_BatchMeta_BatchType_Ordered,
};
GPBEnumDescriptor *worker =
[GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(Transaction_Payload_BatchMeta_BatchType)
valueNames:valueNames
values:values
count:(uint32_t)(sizeof(values) / sizeof(int32_t))
enumVerifier:Transaction_Payload_BatchMeta_BatchType_IsValidValue];
if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) {
[worker release];
}
}
return descriptor;
}
BOOL Transaction_Payload_BatchMeta_BatchType_IsValidValue(int32_t value__) {
switch (value__) {
case Transaction_Payload_BatchMeta_BatchType_Atomic:
case Transaction_Payload_BatchMeta_BatchType_Ordered:
return YES;
default:
return NO;
}
}
#pragma mark - Transaction_Payload_ReducedPayload
@implementation Transaction_Payload_ReducedPayload
@dynamic commandsArray, commandsArray_Count;
@dynamic creatorAccountId;
@dynamic createdTime;
@dynamic quorum;
typedef struct Transaction_Payload_ReducedPayload__storage_ {
uint32_t _has_storage_[1];
uint32_t quorum;
NSMutableArray *commandsArray;
NSString *creatorAccountId;
uint64_t createdTime;
} Transaction_Payload_ReducedPayload__storage_;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = nil;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "commandsArray",
.dataTypeSpecific.className = GPBStringifySymbol(Command),
.number = Transaction_Payload_ReducedPayload_FieldNumber_CommandsArray,
.hasIndex = GPBNoHasBit,
.offset = (uint32_t)offsetof(Transaction_Payload_ReducedPayload__storage_, commandsArray),
.flags = GPBFieldRepeated,
.dataType = GPBDataTypeMessage,
},
{
.name = "creatorAccountId",
.dataTypeSpecific.className = NULL,
.number = Transaction_Payload_ReducedPayload_FieldNumber_CreatorAccountId,
.hasIndex = 0,
.offset = (uint32_t)offsetof(Transaction_Payload_ReducedPayload__storage_, creatorAccountId),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeString,
},
{
.name = "createdTime",
.dataTypeSpecific.className = NULL,
.number = Transaction_Payload_ReducedPayload_FieldNumber_CreatedTime,
.hasIndex = 1,
.offset = (uint32_t)offsetof(Transaction_Payload_ReducedPayload__storage_, createdTime),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeUInt64,
},
{
.name = "quorum",
.dataTypeSpecific.className = NULL,
.number = Transaction_Payload_ReducedPayload_FieldNumber_Quorum,
.hasIndex = 2,
.offset = (uint32_t)offsetof(Transaction_Payload_ReducedPayload__storage_, quorum),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeUInt32,
},
};
GPBDescriptor *localDescriptor =
[GPBDescriptor allocDescriptorForClass:[Transaction_Payload_ReducedPayload class]
rootClass:[TransactionRoot class]
file:TransactionRoot_FileDescriptor()
fields:fields
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
storageSize:sizeof(Transaction_Payload_ReducedPayload__storage_)
flags:GPBDescriptorInitializationFlag_None];
[localDescriptor setupContainingMessageClassName:GPBStringifySymbol(Transaction_Payload)];
NSAssert(descriptor == nil, @"Startup recursed!");
descriptor = localDescriptor;
}
return descriptor;
}
@end
#pragma clang diagnostic pop
// @@protoc_insertion_point(global_scope)