1 // This file was automatically generated by protocompiler
5 #import "AWDIPMonitorInterfaceAdvisoryReport.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
10 @implementation AWDIPMonitorInterfaceAdvisoryReport
12 @synthesize timestamp = _timestamp;
13 - (void)setTimestamp:(uint64_t)v
18 - (void)setHasTimestamp:(BOOL)f
24 return _has.timestamp;
26 @synthesize interfaceType = _interfaceType;
27 - (AWDIPMonitorInterfaceType)interfaceType
29 return _has.interfaceType ? _interfaceType : AWDIPMonitorInterfaceType_IPMONITOR_INTERFACE_TYPE_OTHER;
31 - (void)setInterfaceType:(AWDIPMonitorInterfaceType)v
33 _has.interfaceType = YES;
36 - (void)setHasInterfaceType:(BOOL)f
38 _has.interfaceType = f;
40 - (BOOL)hasInterfaceType
42 return _has.interfaceType;
44 - (NSString *)interfaceTypeAsString:(AWDIPMonitorInterfaceType)value
46 return AWDIPMonitorInterfaceTypeAsString(value);
48 - (AWDIPMonitorInterfaceType)StringAsInterfaceType:(NSString *)str
50 return StringAsAWDIPMonitorInterfaceType(str);
52 @synthesize flags = _flags;
53 - (void)setFlags:(uint32_t)v
58 - (void)setHasFlags:(BOOL)f
66 @synthesize advisoryCount = _advisoryCount;
67 - (void)setAdvisoryCount:(uint32_t)v
69 _has.advisoryCount = YES;
72 - (void)setHasAdvisoryCount:(BOOL)f
74 _has.advisoryCount = f;
76 - (BOOL)hasAdvisoryCount
78 return _has.advisoryCount;
81 - (NSString *)description
83 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
86 - (NSDictionary *)dictionaryRepresentation
88 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
89 if (self->_has.timestamp)
91 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_timestamp] forKey:@"timestamp"];
93 if (self->_has.interfaceType)
95 [dict setObject:AWDIPMonitorInterfaceTypeAsString(self->_interfaceType) forKey:@"interface_type"];
99 [dict setObject:[NSNumber numberWithUnsignedInt:self->_flags] forKey:@"flags"];
101 if (self->_has.advisoryCount)
103 [dict setObject:[NSNumber numberWithUnsignedInt:self->_advisoryCount] forKey:@"advisory_count"];
108 BOOL AWDIPMonitorInterfaceAdvisoryReportReadFrom(AWDIPMonitorInterfaceAdvisoryReport *self, PBDataReader *reader) {
109 while (PBReaderHasMoreData(reader)) {
113 PBReaderReadTag32AndType(reader, &tag, &aType);
115 if (PBReaderHasError(reader))
118 if (aType == TYPE_END_GROUP) {
124 case 1 /* timestamp */:
126 self->_has.timestamp = YES;
127 self->_timestamp = PBReaderReadUint64(reader);
130 case 2 /* interfaceType */:
132 self->_has.interfaceType = YES;
133 self->_interfaceType = PBReaderReadInt32(reader);
138 self->_has.flags = YES;
139 self->_flags = PBReaderReadUint32(reader);
142 case 4 /* advisoryCount */:
144 self->_has.advisoryCount = YES;
145 self->_advisoryCount = PBReaderReadUint32(reader);
149 if (!PBReaderSkipValueWithTag(reader, tag, aType))
154 return !PBReaderHasError(reader);
157 - (BOOL)readFrom:(PBDataReader *)reader
159 return AWDIPMonitorInterfaceAdvisoryReportReadFrom(self, reader);
161 - (void)writeTo:(PBDataWriter *)writer
165 if (self->_has.timestamp)
167 PBDataWriterWriteUint64Field(writer, self->_timestamp, 1);
172 if (self->_has.interfaceType)
174 PBDataWriterWriteInt32Field(writer, self->_interfaceType, 2);
179 if (self->_has.flags)
181 PBDataWriterWriteUint32Field(writer, self->_flags, 3);
186 if (self->_has.advisoryCount)
188 PBDataWriterWriteUint32Field(writer, self->_advisoryCount, 4);
193 - (void)copyTo:(AWDIPMonitorInterfaceAdvisoryReport *)other
195 if (self->_has.timestamp)
197 other->_timestamp = _timestamp;
198 other->_has.timestamp = YES;
200 if (self->_has.interfaceType)
202 other->_interfaceType = _interfaceType;
203 other->_has.interfaceType = YES;
205 if (self->_has.flags)
207 other->_flags = _flags;
208 other->_has.flags = YES;
210 if (self->_has.advisoryCount)
212 other->_advisoryCount = _advisoryCount;
213 other->_has.advisoryCount = YES;
217 - (id)copyWithZone:(NSZone *)zone
219 AWDIPMonitorInterfaceAdvisoryReport *copy = [[[self class] allocWithZone:zone] init];
220 if (self->_has.timestamp)
222 copy->_timestamp = _timestamp;
223 copy->_has.timestamp = YES;
225 if (self->_has.interfaceType)
227 copy->_interfaceType = _interfaceType;
228 copy->_has.interfaceType = YES;
230 if (self->_has.flags)
232 copy->_flags = _flags;
233 copy->_has.flags = YES;
235 if (self->_has.advisoryCount)
237 copy->_advisoryCount = _advisoryCount;
238 copy->_has.advisoryCount = YES;
243 - (BOOL)isEqual:(id)object
245 AWDIPMonitorInterfaceAdvisoryReport *other = (AWDIPMonitorInterfaceAdvisoryReport *)object;
246 return [other isMemberOfClass:[self class]]
248 ((self->_has.timestamp && other->_has.timestamp && self->_timestamp == other->_timestamp) || (!self->_has.timestamp && !other->_has.timestamp))
250 ((self->_has.interfaceType && other->_has.interfaceType && self->_interfaceType == other->_interfaceType) || (!self->_has.interfaceType && !other->_has.interfaceType))
252 ((self->_has.flags && other->_has.flags && self->_flags == other->_flags) || (!self->_has.flags && !other->_has.flags))
254 ((self->_has.advisoryCount && other->_has.advisoryCount && self->_advisoryCount == other->_advisoryCount) || (!self->_has.advisoryCount && !other->_has.advisoryCount))
262 (self->_has.timestamp ? PBHashInt((NSUInteger)self->_timestamp) : 0)
264 (self->_has.interfaceType ? PBHashInt((NSUInteger)self->_interfaceType) : 0)
266 (self->_has.flags ? PBHashInt((NSUInteger)self->_flags) : 0)
268 (self->_has.advisoryCount ? PBHashInt((NSUInteger)self->_advisoryCount) : 0)
272 - (void)mergeFrom:(AWDIPMonitorInterfaceAdvisoryReport *)other
274 if (other->_has.timestamp)
276 self->_timestamp = other->_timestamp;
277 self->_has.timestamp = YES;
279 if (other->_has.interfaceType)
281 self->_interfaceType = other->_interfaceType;
282 self->_has.interfaceType = YES;
284 if (other->_has.flags)
286 self->_flags = other->_flags;
287 self->_has.flags = YES;
289 if (other->_has.advisoryCount)
291 self->_advisoryCount = other->_advisoryCount;
292 self->_has.advisoryCount = YES;