]> git.saurik.com Git - apple/security.git/blob - keychain/ot/proto/generated_source/OTSponsorToApplicantRound1M2.m
Security-59754.41.1.tar.gz
[apple/security.git] / keychain / ot / proto / generated_source / OTSponsorToApplicantRound1M2.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from OTPairingMessage.proto
4
5 #import "OTSponsorToApplicantRound1M2.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
9
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.
12 #endif
13
14 @implementation OTSponsorToApplicantRound1M2
15
16 @synthesize epoch = _epoch;
17 - (void)setEpoch:(uint64_t)v
18 {
19 _has.epoch = YES;
20 _epoch = v;
21 }
22 - (void)setHasEpoch:(BOOL)f
23 {
24 _has.epoch = f;
25 }
26 - (BOOL)hasEpoch
27 {
28 return _has.epoch != 0;
29 }
30
31 - (NSString *)description
32 {
33 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
34 }
35
36 - (NSDictionary *)dictionaryRepresentation
37 {
38 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
39 if (self->_has.epoch)
40 {
41 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_epoch] forKey:@"epoch"];
42 }
43 return dict;
44 }
45
46 BOOL OTSponsorToApplicantRound1M2ReadFrom(__unsafe_unretained OTSponsorToApplicantRound1M2 *self, __unsafe_unretained PBDataReader *reader) {
47 while (PBReaderHasMoreData(reader)) {
48 uint32_t tag = 0;
49 uint8_t aType = 0;
50
51 PBReaderReadTag32AndType(reader, &tag, &aType);
52
53 if (PBReaderHasError(reader))
54 break;
55
56 if (aType == TYPE_END_GROUP) {
57 break;
58 }
59
60 switch (tag) {
61
62 case 1 /* epoch */:
63 {
64 self->_has.epoch = YES;
65 self->_epoch = PBReaderReadUint64(reader);
66 }
67 break;
68 default:
69 if (!PBReaderSkipValueWithTag(reader, tag, aType))
70 return NO;
71 break;
72 }
73 }
74 return !PBReaderHasError(reader);
75 }
76
77 - (BOOL)readFrom:(PBDataReader *)reader
78 {
79 return OTSponsorToApplicantRound1M2ReadFrom(self, reader);
80 }
81 - (void)writeTo:(PBDataWriter *)writer
82 {
83 /* epoch */
84 {
85 if (self->_has.epoch)
86 {
87 PBDataWriterWriteUint64Field(writer, self->_epoch, 1);
88 }
89 }
90 }
91
92 - (void)copyTo:(OTSponsorToApplicantRound1M2 *)other
93 {
94 if (self->_has.epoch)
95 {
96 other->_epoch = _epoch;
97 other->_has.epoch = YES;
98 }
99 }
100
101 - (id)copyWithZone:(NSZone *)zone
102 {
103 OTSponsorToApplicantRound1M2 *copy = [[[self class] allocWithZone:zone] init];
104 if (self->_has.epoch)
105 {
106 copy->_epoch = _epoch;
107 copy->_has.epoch = YES;
108 }
109 return copy;
110 }
111
112 - (BOOL)isEqual:(id)object
113 {
114 OTSponsorToApplicantRound1M2 *other = (OTSponsorToApplicantRound1M2 *)object;
115 return [other isMemberOfClass:[self class]]
116 &&
117 ((self->_has.epoch && other->_has.epoch && self->_epoch == other->_epoch) || (!self->_has.epoch && !other->_has.epoch))
118 ;
119 }
120
121 - (NSUInteger)hash
122 {
123 return 0
124 ^
125 (self->_has.epoch ? PBHashInt((NSUInteger)self->_epoch) : 0)
126 ;
127 }
128
129 - (void)mergeFrom:(OTSponsorToApplicantRound1M2 *)other
130 {
131 if (other->_has.epoch)
132 {
133 self->_epoch = other->_epoch;
134 self->_has.epoch = YES;
135 }
136 }
137
138 @end
139