ObjFW  Diff

Differences From Artifact [07598bfdef]:

  • File src/OFIntrospection.h — part of check-in [0a73af49f0] at 2017-04-30 13:35:16 on branch trunk — Use nonatomic for properties and clean up

    This changes retaining behavior, meaning properties are not returned
    retained and autoreleased anymore, so a property returned from a getter
    now needs to be manually retained and autoreleased before calling the
    setter. However, this is rarely the case and not using atomic improves
    performance. (user: js, size: 5707) [annotate] [blame] [check-ins using]

To Artifact [fb7189fbfa]:


143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*!
 * @class OFIntrospection OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for introspecting classes.
 */
@interface OFIntrospection: OFObject
{
	OFMutableArray OF_GENERIC(OFMethod*) *_classMethods;
	OFMutableArray OF_GENERIC(OFMethod*) *_instanceMethods;
	OFMutableArray OF_GENERIC(OFProperty*) *_properties;
	OFMutableArray OF_GENERIC(OFInstanceVariable*) *_instanceVariables;
}

/*!
 * The class methods of the class.
 */
@property (readonly, nonatomic) OFArray OF_GENERIC(OFMethod*) *classMethods;

/*!
 * The instance methods of the class.
 */
@property (readonly, nonatomic) OFArray OF_GENERIC(OFMethod*) *instanceMethods;

/*!
 * The properties of the class.
 *
 * @warning **Do not rely on this, as this behaves differently depending on the
 *	    compiler and ABI used!**
 *







|
|
|
|





|




|







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*!
 * @class OFIntrospection OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for introspecting classes.
 */
@interface OFIntrospection: OFObject
{
	OFMutableArray OF_GENERIC(OFMethod *) *_classMethods;
	OFMutableArray OF_GENERIC(OFMethod *) *_instanceMethods;
	OFMutableArray OF_GENERIC(OFProperty *) *_properties;
	OFMutableArray OF_GENERIC(OFInstanceVariable *) *_instanceVariables;
}

/*!
 * The class methods of the class.
 */
@property (readonly, nonatomic) OFArray OF_GENERIC(OFMethod *) *classMethods;

/*!
 * The instance methods of the class.
 */
@property (readonly, nonatomic) OFArray OF_GENERIC(OFMethod *) *instanceMethods;

/*!
 * The properties of the class.
 *
 * @warning **Do not rely on this, as this behaves differently depending on the
 *	    compiler and ABI used!**
 *
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
 *	    introspection for every property that has been declared using
 *	    `@``property`, even if no `@``synchronize` or `@``dynamic` has been
 *	    used.
 *
 * @warning GCC does not emit any data for property introspection for the GNU
 *	    ABI.
 */
@property (readonly, nonatomic) OFArray OF_GENERIC(OFProperty*) *properties;

/*!
 * The instance variables of the class.
 */
@property (readonly, nonatomic)
    OFArray OF_GENERIC(OFInstanceVariable*) *instanceVariables;

/* TODO: protocols */

/*!
 * @brief Creates a new introspection for the specified class.
 *
 * @return A new, autoreleased introspection for the specified class







|





|







179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
 *	    introspection for every property that has been declared using
 *	    `@``property`, even if no `@``synchronize` or `@``dynamic` has been
 *	    used.
 *
 * @warning GCC does not emit any data for property introspection for the GNU
 *	    ABI.
 */
@property (readonly, nonatomic) OFArray OF_GENERIC(OFProperty *) *properties;

/*!
 * The instance variables of the class.
 */
@property (readonly, nonatomic)
    OFArray OF_GENERIC(OFInstanceVariable *) *instanceVariables;

/* TODO: protocols */

/*!
 * @brief Creates a new introspection for the specified class.
 *
 * @return A new, autoreleased introspection for the specified class