]> git.saurik.com Git - apple/configd.git/blob - IPMonitorControl/AWD/AWDIPMonitorInterfaceAdvisoryReport.m
configd-1109.101.1.tar.gz
[apple/configd.git] / IPMonitorControl / AWD / AWDIPMonitorInterfaceAdvisoryReport.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from stdin
4
5 #import "AWDIPMonitorInterfaceAdvisoryReport.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
9
10 @implementation AWDIPMonitorInterfaceAdvisoryReport
11
12 @synthesize timestamp = _timestamp;
13 - (void)setTimestamp:(uint64_t)v
14 {
15 _has.timestamp = YES;
16 _timestamp = v;
17 }
18 - (void)setHasTimestamp:(BOOL)f
19 {
20 _has.timestamp = f;
21 }
22 - (BOOL)hasTimestamp
23 {
24 return _has.timestamp;
25 }
26 @synthesize interfaceType = _interfaceType;
27 - (AWDIPMonitorInterfaceType)interfaceType
28 {
29 return _has.interfaceType ? _interfaceType : AWDIPMonitorInterfaceType_IPMONITOR_INTERFACE_TYPE_OTHER;
30 }
31 - (void)setInterfaceType:(AWDIPMonitorInterfaceType)v
32 {
33 _has.interfaceType = YES;
34 _interfaceType = v;
35 }
36 - (void)setHasInterfaceType:(BOOL)f
37 {
38 _has.interfaceType = f;
39 }
40 - (BOOL)hasInterfaceType
41 {
42 return _has.interfaceType;
43 }
44 - (NSString *)interfaceTypeAsString:(AWDIPMonitorInterfaceType)value
45 {
46 return AWDIPMonitorInterfaceTypeAsString(value);
47 }
48 - (AWDIPMonitorInterfaceType)StringAsInterfaceType:(NSString *)str
49 {
50 return StringAsAWDIPMonitorInterfaceType(str);
51 }
52 @synthesize flags = _flags;
53 - (void)setFlags:(uint32_t)v
54 {
55 _has.flags = YES;
56 _flags = v;
57 }
58 - (void)setHasFlags:(BOOL)f
59 {
60 _has.flags = f;
61 }
62 - (BOOL)hasFlags
63 {
64 return _has.flags;
65 }
66 @synthesize advisoryCount = _advisoryCount;
67 - (void)setAdvisoryCount:(uint32_t)v
68 {
69 _has.advisoryCount = YES;
70 _advisoryCount = v;
71 }
72 - (void)setHasAdvisoryCount:(BOOL)f
73 {
74 _has.advisoryCount = f;
75 }
76 - (BOOL)hasAdvisoryCount
77 {
78 return _has.advisoryCount;
79 }
80
81 - (NSString *)description
82 {
83 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
84 }
85
86 - (NSDictionary *)dictionaryRepresentation
87 {
88 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
89 if (self->_has.timestamp)
90 {
91 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_timestamp] forKey:@"timestamp"];
92 }
93 if (self->_has.interfaceType)
94 {
95 [dict setObject:AWDIPMonitorInterfaceTypeAsString(self->_interfaceType) forKey:@"interface_type"];
96 }
97 if (self->_has.flags)
98 {
99 [dict setObject:[NSNumber numberWithUnsignedInt:self->_flags] forKey:@"flags"];
100 }
101 if (self->_has.advisoryCount)
102 {
103 [dict setObject:[NSNumber numberWithUnsignedInt:self->_advisoryCount] forKey:@"advisory_count"];
104 }
105 return dict;
106 }
107
108 BOOL AWDIPMonitorInterfaceAdvisoryReportReadFrom(AWDIPMonitorInterfaceAdvisoryReport *self, PBDataReader *reader) {
109 while (PBReaderHasMoreData(reader)) {
110 uint32_t tag = 0;
111 uint8_t aType = 0;
112
113 PBReaderReadTag32AndType(reader, &tag, &aType);
114
115 if (PBReaderHasError(reader))
116 break;
117
118 if (aType == TYPE_END_GROUP) {
119 break;
120 }
121
122 switch (tag) {
123
124 case 1 /* timestamp */:
125 {
126 self->_has.timestamp = YES;
127 self->_timestamp = PBReaderReadUint64(reader);
128 }
129 break;
130 case 2 /* interfaceType */:
131 {
132 self->_has.interfaceType = YES;
133 self->_interfaceType = PBReaderReadInt32(reader);
134 }
135 break;
136 case 3 /* flags */:
137 {
138 self->_has.flags = YES;
139 self->_flags = PBReaderReadUint32(reader);
140 }
141 break;
142 case 4 /* advisoryCount */:
143 {
144 self->_has.advisoryCount = YES;
145 self->_advisoryCount = PBReaderReadUint32(reader);
146 }
147 break;
148 default:
149 if (!PBReaderSkipValueWithTag(reader, tag, aType))
150 return NO;
151 break;
152 }
153 }
154 return !PBReaderHasError(reader);
155 }
156
157 - (BOOL)readFrom:(PBDataReader *)reader
158 {
159 return AWDIPMonitorInterfaceAdvisoryReportReadFrom(self, reader);
160 }
161 - (void)writeTo:(PBDataWriter *)writer
162 {
163 /* timestamp */
164 {
165 if (self->_has.timestamp)
166 {
167 PBDataWriterWriteUint64Field(writer, self->_timestamp, 1);
168 }
169 }
170 /* interfaceType */
171 {
172 if (self->_has.interfaceType)
173 {
174 PBDataWriterWriteInt32Field(writer, self->_interfaceType, 2);
175 }
176 }
177 /* flags */
178 {
179 if (self->_has.flags)
180 {
181 PBDataWriterWriteUint32Field(writer, self->_flags, 3);
182 }
183 }
184 /* advisoryCount */
185 {
186 if (self->_has.advisoryCount)
187 {
188 PBDataWriterWriteUint32Field(writer, self->_advisoryCount, 4);
189 }
190 }
191 }
192
193 - (void)copyTo:(AWDIPMonitorInterfaceAdvisoryReport *)other
194 {
195 if (self->_has.timestamp)
196 {
197 other->_timestamp = _timestamp;
198 other->_has.timestamp = YES;
199 }
200 if (self->_has.interfaceType)
201 {
202 other->_interfaceType = _interfaceType;
203 other->_has.interfaceType = YES;
204 }
205 if (self->_has.flags)
206 {
207 other->_flags = _flags;
208 other->_has.flags = YES;
209 }
210 if (self->_has.advisoryCount)
211 {
212 other->_advisoryCount = _advisoryCount;
213 other->_has.advisoryCount = YES;
214 }
215 }
216
217 - (id)copyWithZone:(NSZone *)zone
218 {
219 AWDIPMonitorInterfaceAdvisoryReport *copy = [[[self class] allocWithZone:zone] init];
220 if (self->_has.timestamp)
221 {
222 copy->_timestamp = _timestamp;
223 copy->_has.timestamp = YES;
224 }
225 if (self->_has.interfaceType)
226 {
227 copy->_interfaceType = _interfaceType;
228 copy->_has.interfaceType = YES;
229 }
230 if (self->_has.flags)
231 {
232 copy->_flags = _flags;
233 copy->_has.flags = YES;
234 }
235 if (self->_has.advisoryCount)
236 {
237 copy->_advisoryCount = _advisoryCount;
238 copy->_has.advisoryCount = YES;
239 }
240 return copy;
241 }
242
243 - (BOOL)isEqual:(id)object
244 {
245 AWDIPMonitorInterfaceAdvisoryReport *other = (AWDIPMonitorInterfaceAdvisoryReport *)object;
246 return [other isMemberOfClass:[self class]]
247 &&
248 ((self->_has.timestamp && other->_has.timestamp && self->_timestamp == other->_timestamp) || (!self->_has.timestamp && !other->_has.timestamp))
249 &&
250 ((self->_has.interfaceType && other->_has.interfaceType && self->_interfaceType == other->_interfaceType) || (!self->_has.interfaceType && !other->_has.interfaceType))
251 &&
252 ((self->_has.flags && other->_has.flags && self->_flags == other->_flags) || (!self->_has.flags && !other->_has.flags))
253 &&
254 ((self->_has.advisoryCount && other->_has.advisoryCount && self->_advisoryCount == other->_advisoryCount) || (!self->_has.advisoryCount && !other->_has.advisoryCount))
255 ;
256 }
257
258 - (NSUInteger)hash
259 {
260 return 0
261 ^
262 (self->_has.timestamp ? PBHashInt((NSUInteger)self->_timestamp) : 0)
263 ^
264 (self->_has.interfaceType ? PBHashInt((NSUInteger)self->_interfaceType) : 0)
265 ^
266 (self->_has.flags ? PBHashInt((NSUInteger)self->_flags) : 0)
267 ^
268 (self->_has.advisoryCount ? PBHashInt((NSUInteger)self->_advisoryCount) : 0)
269 ;
270 }
271
272 - (void)mergeFrom:(AWDIPMonitorInterfaceAdvisoryReport *)other
273 {
274 if (other->_has.timestamp)
275 {
276 self->_timestamp = other->_timestamp;
277 self->_has.timestamp = YES;
278 }
279 if (other->_has.interfaceType)
280 {
281 self->_interfaceType = other->_interfaceType;
282 self->_has.interfaceType = YES;
283 }
284 if (other->_has.flags)
285 {
286 self->_flags = other->_flags;
287 self->_has.flags = YES;
288 }
289 if (other->_has.advisoryCount)
290 {
291 self->_advisoryCount = other->_advisoryCount;
292 self->_has.advisoryCount = YES;
293 }
294 }
295
296 @end
297