KCInitialMessageData.m   [plain text]

// This file was automatically generated by protocompiler
// DO NOT EDIT!
// Compiled from KCInitialMessageData.proto

#import "KCInitialMessageData.h"
#import <ProtocolBuffer/PBConstants.h>
#import <ProtocolBuffer/PBHashUtil.h>
#import <ProtocolBuffer/PBDataReader.h>

#if !__has_feature(objc_arc)
# 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.
#endif

@implementation KCInitialMessageData

- (BOOL)hasPrepareMessage
{
return _prepareMessage != nil;
}
@synthesize prepareMessage = _prepareMessage;

- (NSString *)description
{
return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
}

- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
if (self->_prepareMessage)
{
[dict setObject:self->_prepareMessage forKey:@"prepareMessage"];
}
return dict;
}

BOOL KCInitialMessageDataReadFrom(__unsafe_unretained KCInitialMessageData *self, __unsafe_unretained PBDataReader *reader) {
while (PBReaderHasMoreData(reader)) {
uint32_t tag = 0;
uint8_t aType = 0;

PBReaderReadTag32AndType(reader, &tag, &aType);

if (PBReaderHasError(reader))
break;

if (aType == TYPE_END_GROUP) {
break;
}

switch (tag) {

case 1 /* prepareMessage */:
{
NSData *new_prepareMessage = PBReaderReadData(reader);
self->_prepareMessage = new_prepareMessage;
}
break;
default:
if (!PBReaderSkipValueWithTag(reader, tag, aType))
return NO;
break;
}
}
return !PBReaderHasError(reader);
}

- (BOOL)readFrom:(PBDataReader *)reader
{
return KCInitialMessageDataReadFrom(self, reader);
}
- (void)writeTo:(PBDataWriter *)writer
{
/* prepareMessage */
{
if (self->_prepareMessage)
{
PBDataWriterWriteDataField(writer, self->_prepareMessage, 1);
}
}
}

- (void)copyTo:(KCInitialMessageData *)other
{
if (_prepareMessage)
{
other.prepareMessage = _prepareMessage;
}
}

- (id)copyWithZone:(NSZone *)zone
{
KCInitialMessageData *copy = [[[self class] allocWithZone:zone] init];
copy->_prepareMessage = [_prepareMessage copyWithZone:zone];
return copy;
}

- (BOOL)isEqual:(id)object
{
KCInitialMessageData *other = (KCInitialMessageData *)object;
return [other isMemberOfClass:[self class]]
&&
((!self->_prepareMessage && !other->_prepareMessage) || [self->_prepareMessage isEqual:other->_prepareMessage])
;
}

- (NSUInteger)hash
{
return 0
^
[self->_prepareMessage hash]
;
}

- (void)mergeFrom:(KCInitialMessageData *)other
{
if (other->_prepareMessage)
{
[self setPrepareMessage:other->_prepareMessage];
}
}

@end