/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ /** * @generated by Thrift */ #import #import #import #import #import #import #import #import #import #import #import "transitive.h" static Foo * ExampleFoo; @implementation transitiveConstants + (void) initialize { ExampleFoo = [[Foo alloc] init]; [ExampleFoo setA:2]; ; } + (Foo *) ExampleFoo{ return ExampleFoo; } @end @implementation Foo - (instancetype) init { self = [super init]; self.a = 2; return self; } - (id) initWithA: (int64_t) a { self = [super init]; __thrift_a = a; __thrift_a_set = YES; return self; } - (id) initWithCoder: (NSCoder *) decoder { self = [super init]; if ([decoder containsValueForKey: @"a"]) { __thrift_a = [decoder decodeInt64ForKey: @"a"]; __thrift_a_set = YES; } return self; } - (void) encodeWithCoder: (NSCoder *) encoder { if (__thrift_a_set) { [encoder encodeInt64: __thrift_a forKey: @"a"]; } } - (int64_t) a { return __thrift_a; } - (void) setA: (int64_t) a { [self throwExceptionIfImmutable]; __thrift_a = a; __thrift_a_set = YES; } - (BOOL) aIsSet { return __thrift_a_set; } - (void) unsetA { __thrift_a_set = NO; } - (void) read: (id ) inProtocol { NSString * fieldName; int fieldType; int fieldID; [inProtocol readStructBeginReturningName: NULL]; while (true) { [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; if (fieldType == TType_STOP) { break; } switch (fieldID) { case 1: if (fieldType == TType_I64) { int64_t fieldValue = [inProtocol readI64]; [self setA: fieldValue]; } else { [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; } break; default: [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; break; } [inProtocol readFieldEnd]; } [inProtocol readStructEnd]; } - (void) write: (id ) outProtocol { [outProtocol writeStructBeginWithName: @"Foo"]; if (__thrift_a_set) { [outProtocol writeFieldBeginWithName: @"a" type: TType_I64 fieldID: 1]; [outProtocol writeI64: __thrift_a]; [outProtocol writeFieldEnd]; } [outProtocol writeFieldStop]; [outProtocol writeStructEnd]; } - (void) validate { // check for required fields } - (NSString *) description { return [[self toDict] description]; } - (NSDictionary *) toDict { NSMutableDictionary *ret = [NSMutableDictionary dictionary]; ret[@"__thrift_struct_name"] = @"Foo"; ret[@"a"] = @(__thrift_a); return [ret copy]; } - (BOOL) makeImmutable { const BOOL wasImmutable = [self isImmutable]; if (!wasImmutable) { [super makeImmutable]; } return YES; } - (id) mutableCopyWithZone:(NSZone *)zone { Foo *newCopy = [[[self class] alloc] init];; newCopy->__thrift_a = self->__thrift_a; newCopy->__thrift_a_set = self->__thrift_a_set; return newCopy; } @end