@@ -24,10 +24,12 @@ #import "OFArray.h" #import "OFInitializationFailedException.h" @implementation OFMethod +@synthesize selector = _selector, name = _name, typeEncoding = _typeEncoding; + #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithMethod: (struct objc_method*)method { self = [super init]; @@ -74,25 +76,10 @@ [_name release]; [super dealloc]; } -- (SEL)selector -{ - return _selector; -} - -- (OFString*)name -{ - OF_GETTER(_name, true) -} - -- (const char*)typeEncoding -{ - return _typeEncoding; -} - - (OFString*)description { return [OFString stringWithFormat: @"<%@: %@ [%s]>", [self class], _name, _typeEncoding]; } @@ -144,10 +131,13 @@ return hash; } @end @implementation OFProperty +@synthesize name = _name, attributes = _attributes; +@synthesize getter = _getter, setter = _setter; + #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithProperty: (struct objc_property*)property { self = [super init]; @@ -314,30 +304,10 @@ [_setter release]; [super dealloc]; } -- (OFString*)name -{ - OF_GETTER(_name, true) -} - -- (unsigned)attributes -{ - return _attributes; -} - -- (OFString*)getter -{ - OF_GETTER(_getter, true) -} - -- (OFString*)setter -{ - OF_GETTER(_setter, true) -} - - (OFString*)description { return [OFString stringWithFormat: @"<%@: %@\n" @"\tAttributes = 0x%03X\n" @@ -386,10 +356,12 @@ return hash; } @end @implementation OFInstanceVariable +@synthesize name = _name, offset = _offset, typeEncoding = _typeEncoding; + #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithIvar: (struct objc_ivar*)ivar { self = [super init]; @@ -435,34 +407,22 @@ [_name release]; [super dealloc]; } -- (OFString*)name -{ - OF_GETTER(_name, true); -} - -- (ptrdiff_t)offset -{ - return _offset; -} - -- (const char*)typeEncoding -{ - return _typeEncoding; -} - - (OFString*)description { return [OFString stringWithFormat: @"", _name, _typeEncoding, _offset]; } @end @implementation OFIntrospection +@synthesize classMethods = _classMethods, instanceMethods = _instanceMethods; +@synthesize properties = _properties, instanceVariables = _instanceVariables; + + (instancetype)introspectionWithClass: (Class)class { return [[[self alloc] initWithClass: class] autorelease]; } @@ -620,26 +580,6 @@ [_instanceMethods release]; [_instanceVariables release]; [super dealloc]; } - -- (OFArray*)classMethods -{ - OF_GETTER(_classMethods, true) -} - -- (OFArray*)instanceMethods -{ - OF_GETTER(_instanceMethods, true) -} - -- (OFArray*)properties -{ - OF_GETTER(_properties, true) -} - -- (OFArray*)instanceVariables -{ - OF_GETTER(_instanceVariables, true) -} @end