1 // This file was automatically generated by protocompiler
3 // Compiled from C2Metric.proto
5 #import "SECC2MPCloudKitOperationInfo.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
10 #if !__has_feature(objc_arc)
11 # error This generated file depends on ARC but it is not enabled; turn on ARC, or use 'objc_use_arc' option to generate non-ARC code.
14 @implementation SECC2MPCloudKitOperationInfo
16 - (BOOL)hasOperationId
18 return _operationId != nil;
20 @synthesize operationId = _operationId;
21 - (BOOL)hasOperationType
23 return _operationType != nil;
25 @synthesize operationType = _operationType;
26 @synthesize operationTriggered = _operationTriggered;
27 - (void)setOperationTriggered:(BOOL)v
29 _has.operationTriggered = YES;
30 _operationTriggered = v;
32 - (void)setHasOperationTriggered:(BOOL)f
34 _has.operationTriggered = f;
36 - (BOOL)hasOperationTriggered
38 return _has.operationTriggered;
40 @synthesize operationGroupIndex = _operationGroupIndex;
41 - (void)setOperationGroupIndex:(uint32_t)v
43 _has.operationGroupIndex = YES;
44 _operationGroupIndex = v;
46 - (void)setHasOperationGroupIndex:(BOOL)f
48 _has.operationGroupIndex = f;
50 - (BOOL)hasOperationGroupIndex
52 return _has.operationGroupIndex;
55 - (NSString *)description
57 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
60 - (NSDictionary *)dictionaryRepresentation
62 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
63 if (self->_operationId)
65 [dict setObject:self->_operationId forKey:@"operation_id"];
67 if (self->_operationType)
69 [dict setObject:self->_operationType forKey:@"operation_type"];
71 if (self->_has.operationTriggered)
73 [dict setObject:[NSNumber numberWithBool:self->_operationTriggered] forKey:@"operation_triggered"];
75 if (self->_has.operationGroupIndex)
77 [dict setObject:[NSNumber numberWithUnsignedInt:self->_operationGroupIndex] forKey:@"operation_group_index"];
82 BOOL SECC2MPCloudKitOperationInfoReadFrom(__unsafe_unretained SECC2MPCloudKitOperationInfo *self, __unsafe_unretained PBDataReader *reader) {
83 while (PBReaderHasMoreData(reader)) {
87 PBReaderReadTag32AndType(reader, &tag, &aType);
89 if (PBReaderHasError(reader))
92 if (aType == TYPE_END_GROUP) {
98 case 1 /* operationId */:
100 NSString *new_operationId = PBReaderReadString(reader);
101 self->_operationId = new_operationId;
104 case 2 /* operationType */:
106 NSString *new_operationType = PBReaderReadString(reader);
107 self->_operationType = new_operationType;
110 case 101 /* operationTriggered */:
112 self->_has.operationTriggered = YES;
113 self->_operationTriggered = PBReaderReadBOOL(reader);
116 case 201 /* operationGroupIndex */:
118 self->_has.operationGroupIndex = YES;
119 self->_operationGroupIndex = PBReaderReadUint32(reader);
123 if (!PBReaderSkipValueWithTag(reader, tag, aType))
128 return !PBReaderHasError(reader);
131 - (BOOL)readFrom:(PBDataReader *)reader
133 return SECC2MPCloudKitOperationInfoReadFrom(self, reader);
135 - (void)writeTo:(PBDataWriter *)writer
139 if (self->_operationId)
141 PBDataWriterWriteStringField(writer, self->_operationId, 1);
146 if (self->_operationType)
148 PBDataWriterWriteStringField(writer, self->_operationType, 2);
151 /* operationTriggered */
153 if (self->_has.operationTriggered)
155 PBDataWriterWriteBOOLField(writer, self->_operationTriggered, 101);
158 /* operationGroupIndex */
160 if (self->_has.operationGroupIndex)
162 PBDataWriterWriteUint32Field(writer, self->_operationGroupIndex, 201);
167 - (void)copyTo:(SECC2MPCloudKitOperationInfo *)other
171 other.operationId = _operationId;
175 other.operationType = _operationType;
177 if (self->_has.operationTriggered)
179 other->_operationTriggered = _operationTriggered;
180 other->_has.operationTriggered = YES;
182 if (self->_has.operationGroupIndex)
184 other->_operationGroupIndex = _operationGroupIndex;
185 other->_has.operationGroupIndex = YES;
189 - (id)copyWithZone:(NSZone *)zone
191 SECC2MPCloudKitOperationInfo *copy = [[[self class] allocWithZone:zone] init];
192 copy->_operationId = [_operationId copyWithZone:zone];
193 copy->_operationType = [_operationType copyWithZone:zone];
194 if (self->_has.operationTriggered)
196 copy->_operationTriggered = _operationTriggered;
197 copy->_has.operationTriggered = YES;
199 if (self->_has.operationGroupIndex)
201 copy->_operationGroupIndex = _operationGroupIndex;
202 copy->_has.operationGroupIndex = YES;
207 - (BOOL)isEqual:(id)object
209 SECC2MPCloudKitOperationInfo *other = (SECC2MPCloudKitOperationInfo *)object;
210 return [other isMemberOfClass:[self class]]
212 ((!self->_operationId && !other->_operationId) || [self->_operationId isEqual:other->_operationId])
214 ((!self->_operationType && !other->_operationType) || [self->_operationType isEqual:other->_operationType])
216 ((self->_has.operationTriggered && other->_has.operationTriggered && ((self->_operationTriggered && other->_operationTriggered) || (!self->_operationTriggered && !other->_operationTriggered))) || (!self->_has.operationTriggered && !other->_has.operationTriggered))
218 ((self->_has.operationGroupIndex && other->_has.operationGroupIndex && self->_operationGroupIndex == other->_operationGroupIndex) || (!self->_has.operationGroupIndex && !other->_has.operationGroupIndex))
226 [self->_operationId hash]
228 [self->_operationType hash]
230 (self->_has.operationTriggered ? PBHashInt((NSUInteger)self->_operationTriggered) : 0)
232 (self->_has.operationGroupIndex ? PBHashInt((NSUInteger)self->_operationGroupIndex) : 0)
236 - (void)mergeFrom:(SECC2MPCloudKitOperationInfo *)other
238 if (other->_operationId)
240 [self setOperationId:other->_operationId];
242 if (other->_operationType)
244 [self setOperationType:other->_operationType];
246 if (other->_has.operationTriggered)
248 self->_operationTriggered = other->_operationTriggered;
249 self->_has.operationTriggered = YES;
251 if (other->_has.operationGroupIndex)
253 self->_operationGroupIndex = other->_operationGroupIndex;
254 self->_has.operationGroupIndex = YES;