1 // This file was automatically generated by protocompiler
3 // Compiled from OTCDPRecoveryInformation.proto
5 #import "OTICDPRecordContext.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
10 #import "OTCDPRecoveryInformation.h"
11 #import "OTEscrowAuthenticationInformation.h"
13 #if !__has_feature(objc_arc)
14 # 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.
17 @implementation OTICDPRecordContext
21 return _cdpInfo != nil;
23 @synthesize cdpInfo = _cdpInfo;
26 return _authInfo != nil;
28 @synthesize authInfo = _authInfo;
30 - (NSString *)description
32 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
35 - (NSDictionary *)dictionaryRepresentation
37 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
40 [dict setObject:[_cdpInfo dictionaryRepresentation] forKey:@"cdpInfo"];
44 [dict setObject:[_authInfo dictionaryRepresentation] forKey:@"authInfo"];
49 BOOL OTICDPRecordContextReadFrom(__unsafe_unretained OTICDPRecordContext *self, __unsafe_unretained PBDataReader *reader) {
50 while (PBReaderHasMoreData(reader)) {
54 PBReaderReadTag32AndType(reader, &tag, &aType);
56 if (PBReaderHasError(reader))
59 if (aType == TYPE_END_GROUP) {
67 OTCDPRecoveryInformation *new_cdpInfo = [[OTCDPRecoveryInformation alloc] init];
68 self->_cdpInfo = new_cdpInfo;
69 PBDataReaderMark mark_cdpInfo;
70 BOOL markError = !PBReaderPlaceMark(reader, &mark_cdpInfo);
75 BOOL inError = !OTCDPRecoveryInformationReadFrom(new_cdpInfo, reader);
80 PBReaderRecallMark(reader, &mark_cdpInfo);
83 case 2 /* authInfo */:
85 OTEscrowAuthenticationInformation *new_authInfo = [[OTEscrowAuthenticationInformation alloc] init];
86 self->_authInfo = new_authInfo;
87 PBDataReaderMark mark_authInfo;
88 BOOL markError = !PBReaderPlaceMark(reader, &mark_authInfo);
93 BOOL inError = !OTEscrowAuthenticationInformationReadFrom(new_authInfo, reader);
98 PBReaderRecallMark(reader, &mark_authInfo);
102 if (!PBReaderSkipValueWithTag(reader, tag, aType))
107 return !PBReaderHasError(reader);
110 - (BOOL)readFrom:(PBDataReader *)reader
112 return OTICDPRecordContextReadFrom(self, reader);
114 - (void)writeTo:(PBDataWriter *)writer
118 if (self->_cdpInfo != nil)
120 PBDataWriterWriteSubmessage(writer, self->_cdpInfo, 1);
125 if (self->_authInfo != nil)
127 PBDataWriterWriteSubmessage(writer, self->_authInfo, 2);
132 - (void)copyTo:(OTICDPRecordContext *)other
136 other.cdpInfo = _cdpInfo;
140 other.authInfo = _authInfo;
144 - (id)copyWithZone:(NSZone *)zone
146 OTICDPRecordContext *copy = [[[self class] allocWithZone:zone] init];
147 copy->_cdpInfo = [_cdpInfo copyWithZone:zone];
148 copy->_authInfo = [_authInfo copyWithZone:zone];
152 - (BOOL)isEqual:(id)object
154 OTICDPRecordContext *other = (OTICDPRecordContext *)object;
155 return [other isMemberOfClass:[self class]]
157 ((!self->_cdpInfo && !other->_cdpInfo) || [self->_cdpInfo isEqual:other->_cdpInfo])
159 ((!self->_authInfo && !other->_authInfo) || [self->_authInfo isEqual:other->_authInfo])
167 [self->_cdpInfo hash]
169 [self->_authInfo hash]
173 - (void)mergeFrom:(OTICDPRecordContext *)other
175 if (self->_cdpInfo && other->_cdpInfo)
177 [self->_cdpInfo mergeFrom:other->_cdpInfo];
179 else if (!self->_cdpInfo && other->_cdpInfo)
181 [self setCdpInfo:other->_cdpInfo];
183 if (self->_authInfo && other->_authInfo)
185 [self->_authInfo mergeFrom:other->_authInfo];
187 else if (!self->_authInfo && other->_authInfo)
189 [self setAuthInfo:other->_authInfo];