ObjFW
Loading...
Searching...
No Matches
<OFObject> Protocol Reference

The protocol which all root classes implement. More...

#include <ObjFW/ObjFW.h>

Inheritance diagram for <OFObject>:
<OFApplicationDelegate> <OFArchiveEntry> <OFCryptographicHash> <OFDNSResolverQueryDelegate> <OFDatagramSocketDelegate> <OFHTTPClientDelegate> <OFHTTPServerDelegate> <OFKernelEventObserverDelegate> <OFLocking> OFObject <OFReadyForReadingObserving> <OFReadyForWritingObserving> <OFSequencedPacketSocketDelegate> <OFStreamDelegate> <OFStringXMLUnescapingDelegate> <OFXMLElementBuilderDelegate> <OFXMLParserDelegate> <OFZIPArchiveDelegate> <OHGameControllerProfile>

Instance Methods

(Class) - class
 Returns the class of the object.
 
(nullable Class) - superclass
 Returns the superclass of the object.
 
(unsigned long) - hash
 Returns a hash for the object.
 
(unsigned int) - retainCount
 Returns the retain count.
 
(bool) - isProxy
 Returns whether the object is a proxy object.
 
(bool) - isKindOfClass:
 Returns a boolean whether the object is of the specified kind.
 
(bool) - isMemberOfClass:
 Returns a boolean whether the object is a member of the specified class.
 
(bool) - respondsToSelector:
 Returns a boolean whether the object responds to the specified selector.
 
(bool) - conformsToProtocol:
 Checks whether the object conforms to the specified protocol.
 
(nullable IMP- methodForSelector:
 Returns the implementation for the specified selector.
 
(nullable id) - performSelector:
 Performs the specified selector.
 
(nullable id) - performSelector:withObject:
 Performs the specified selector with the specified object.
 
(nullable id) - performSelector:withObject:withObject:
 Performs the specified selector with the specified objects.
 
(nullable id) - performSelector:withObject:withObject:withObject:
 Performs the specified selector with the specified objects.
 
(nullable id) - performSelector:withObject:withObject:withObject:withObject:
 Performs the specified selector with the specified objects.
 
(bool) - isEqual:
 Checks two objects for equality.
 
(instancetype) - retain
 Increases the retain count.
 
(void) - release
 Decreases the retain count.
 
(instancetype) - autorelease
 Adds the object to the topmost autorelease pool of the thread's autorelease pool stack.
 
(instancetype) - self
 Returns the receiver.
 
(bool) - allowsWeakReference
 Returns whether the object allows a weak reference.
 
(bool) - retainWeakReference
 Retain a weak reference to this object.
 

Detailed Description

The protocol which all root classes implement.

Method Documentation

◆ allowsWeakReference

- (bool) allowsWeakReference

Returns whether the object allows a weak reference.

Returns
Whether the object allows a weak references

◆ autorelease

- (instancetype) autorelease

Adds the object to the topmost autorelease pool of the thread's autorelease pool stack.

Returns
The object

◆ class

- (Class) class

Returns the class of the object.

Returns
The class of the object

Reimplemented in OFObject.

◆ conformsToProtocol:

- (bool) conformsToProtocol: (Protocol *) protocol

Checks whether the object conforms to the specified protocol.

Parameters
protocolThe protocol which should be checked for conformance
Returns
A boolean whether the object conforms to the specified protocol

Reimplemented in OFObject.

◆ hash

- (unsigned long) hash

Returns a 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 isEqual: to behave in a way compatible to your reimplementation of this method!
Returns
A hash for the object

◆ isEqual:

- (bool) isEqual: (nullable id) object

Checks two objects for equality.

Classes containing data (like strings, arrays, lists etc.) should reimplement this!

Warning
If you reimplement this, you also need to reimplement hash to return the same hash for objects which are equal!
Parameters
objectThe object which should be tested for equality
Returns
A boolean whether the object is equal to the specified object

Reimplemented in OFSecureData.

◆ isKindOfClass:

- (bool) isKindOfClass: (Class) class_

Returns a boolean whether the object is of the specified kind.

Parameters
class_The class for which the receiver is checked
Returns
A boolean whether the object is of the specified kind

◆ isMemberOfClass:

- (bool) isMemberOfClass: (Class) class_

Returns a boolean whether the object is a member of the specified class.

Parameters
class_The class for which the receiver is checked
Returns
A boolean whether the object is a member of the specified class

◆ isProxy

- (bool) isProxy

Returns whether the object is a proxy object.

Returns
Whether the object is a proxy object

◆ methodForSelector:

- (nullable IMP) methodForSelector: (SEL) selector

Returns the implementation for the specified selector.

Parameters
selectorThe selector for which the method should be returned
Returns
The implementation for the specified selector

◆ performSelector:

- (nullable id) performSelector: (SEL) selector

Performs the specified selector.

Parameters
selectorThe selector to perform
Returns
The object returned by the method specified by the selector

◆ performSelector:withObject:

- (nullable id) performSelector: (SEL) selector
withObject: (nullable id) object 

Performs the specified selector with the specified object.

Parameters
selectorThe selector to perform
objectThe object that is passed to the method specified by the selector
Returns
The object returned by the method specified by the selector

◆ performSelector:withObject:withObject:

- (nullable id) performSelector: (SEL) selector
withObject: (nullable id) object1
withObject: (nullable id) object2 

Performs the specified selector with the specified objects.

Parameters
selectorThe selector to perform
object1The first object that is passed to the method specified by the selector
object2The second object that is passed to the method specified by the selector
Returns
The object returned by the method specified by the selector

◆ performSelector:withObject:withObject:withObject:

- (nullable id) performSelector: (SEL) selector
withObject: (nullable id) object1
withObject: (nullable id) object2
withObject: (nullable id) object3 

Performs the specified selector with the specified objects.

Parameters
selectorThe selector to perform
object1The first object that is passed to the method specified by the selector
object2The second object that is passed to the method specified by the selector
object3The third object that is passed to the method specified by the selector
Returns
The object returned by the method specified by the selector

◆ performSelector:withObject:withObject:withObject:withObject:

- (nullable id) performSelector: (SEL) selector
withObject: (nullable id) object1
withObject: (nullable id) object2
withObject: (nullable id) object3
withObject: (nullable id) object4 

Performs the specified selector with the specified objects.

Parameters
selectorThe selector to perform
object1The first object that is passed to the method specified by the selector
object2The second object that is passed to the method specified by the selector
object3The third object that is passed to the method specified by the selector
object4The fourth object that is passed to the method specified by the selector
Returns
The object returned by the method specified by the selector

◆ release

- (void) release

Decreases the retain count.

Each time an object is released, the retain count gets decreased and the object deallocated if it reaches 0.

◆ respondsToSelector:

- (bool) respondsToSelector: (SEL) selector

Returns a boolean whether the object responds to the specified selector.

Parameters
selectorThe selector which should be checked for respondence
Returns
A boolean whether the objects responds to the specified selector

◆ retain

- (instancetype) retain

Increases the retain count.

Each time an object is released, the retain count gets decreased and the object deallocated if it reaches 0.

◆ retainCount

- (unsigned int) retainCount

Returns the retain count.

Returns
The retain count

◆ retainWeakReference

- (bool) retainWeakReference

Retain a weak reference to this object.

Returns
Whether a weak reference to this object has been retained

◆ self

- (instancetype) self

Returns the receiver.

Returns
The receiver

◆ superclass

- (nullable Class) superclass

Returns the superclass of the object.

Returns
The superclass of the object

Reimplemented in OFObject.


The documentation for this protocol was generated from the following file: