Differences From Artifact [39e5e50197]:
- File
src/OFObject.h
— part of check-in
[2f4e0df8be]
at
2017-10-17 00:33:37
on branch trunk
— Do not use implicit method return types
Instead, explicitly declare them, as OF_ASSUME_NONNULL_{BEGIN,END} does
not apply to implicit return types. This means that after this commit,
all init methods have a nonnull return type, as they should have. (user: js, size: 35063) [annotate] [blame] [check-ins using]
To Artifact [1f2c48e5a0]:
- File
src/OFObject.h
— part of check-in
[f3ccf14461]
at
2017-10-29 21:58:14
on branch trunk
— Convert methods to properties where appropriate
This improves Swift compatibility. (user: js, size: 34879) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
195 196 197 198 199 200 201 | /*! * @protocol OFObject OFObject.h ObjFW/OFObject.h * * @brief The protocol which all root classes implement. */ @protocol OFObject /*! | | > > | > | | > > > > > > > > > > | > > | > | > > > | > > > > | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | /*! * @protocol OFObject OFObject.h ObjFW/OFObject.h * * @brief The protocol which all root classes implement. */ @protocol OFObject /*! * The class of the object. */ @property (readonly, nonatomic) Class class; /*! * The superclass of the object. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) Class superclass; /*! * A 32 bit hash for the object. * * Classes containing data (like strings, arrays, lists etc.) should reimplement * this! * * @warning If you reimplement this, you also need to reimplement @ref isEqual: * to behave in a way compatible to your reimplementation of this * method! */ @property (readonly, nonatomic) uint32_t hash; /*! * The retain count. */ @property (readonly, nonatomic) unsigned int retainCount; /*! * Whether the object is a proxy object. */ @property (readonly, nonatomic) bool isProxy; /*! * Whether the object allows weak references. */ @property (readonly, nonatomic) bool allowsWeakReference; /*! * @brief Returns a boolean whether the object of the specified kind. * * @param class_ The class whose kind is checked * @return A boolean whether the object is of the specified kind */ |
︙ | ︙ | |||
334 335 336 337 338 339 340 | * return the same hash for objects which are equal! * * @param object The object which should be tested for equality * @return A boolean whether the object is equal to the specified object */ - (bool)isEqual: (nullable id)object; | < < < < < < < < < < < < < < < < < < < < < | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | * return the same hash for objects which are equal! * * @param object The object which should be tested for equality * @return A boolean whether the object is equal to the specified object */ - (bool)isEqual: (nullable id)object; /*! * @brief Increases the retain count. * * Each time an object is released, the retain count gets decreased and the * object deallocated if it reaches 0. */ - (instancetype)retain; /*! * @brief Decreases the retain count. * * Each time an object is released, the retain count gets decreased and the * object deallocated if it reaches 0. */ - (void)release; |
︙ | ︙ | |||
386 387 388 389 390 391 392 | /*! * @brief Returns the receiver. * * @return The receiver */ - (instancetype)self; | < < < < < < < < < < < < < < | 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | /*! * @brief Returns the receiver. * * @return The receiver */ - (instancetype)self; /*! * @brief Retain a weak reference to this object. * * @return Whether a weak reference to this object has been retained */ - (bool)retainWeakReference; @end |
︙ | ︙ | |||
424 425 426 427 428 429 430 431 432 433 434 435 436 437 | #ifndef __clang_analyzer__ Class _isa; #else Class _isa __attribute__((__unused__)); #endif } /*! * @brief A method which is called once when the class is loaded into the * runtime. * * Derived classes can override this to execute their own code when the class * is loaded. */ | > > > > > > > > > > > > > | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | #ifndef __clang_analyzer__ Class _isa; #else Class _isa __attribute__((__unused__)); #endif } /*! * The name of the object's class. */ @property (readonly, nonatomic) OFString *className; /*! * A description for the object. * * This is used when the object is used in a format string and for debugging * purposes. */ @property (readonly, nonatomic) OFString *description; /*! * @brief A method which is called once when the class is loaded into the * runtime. * * Derived classes can override this to execute their own code when the class * is loaded. */ |
︙ | ︙ | |||
648 649 650 651 652 653 654 | * * @param selector The selector for which the method signature should be * returned * @return The method signature for the specified selector */ - (nullable OFMethodSignature *)methodSignatureForSelector: (SEL)selector; | < < < < < < < < < < < < < < < < | 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | * * @param selector The selector for which the method signature should be * returned * @return The method signature for the specified selector */ - (nullable OFMethodSignature *)methodSignatureForSelector: (SEL)selector; /*! * @brief Allocates memory and stores it in the object's memory pool. * * It will be freed automatically when the object is deallocated. * * @param size The size of the memory to allocate * @return A pointer to the allocated memory. May return NULL if the specified |
︙ | ︙ |