A pool of objects, which are released when the pool is drained. More...
#import <Foundation/Foundation.h>


Instance Methods | |
| (void) | - addObject: |
| Adds an object to the pool. More... | |
| (void) | - drain |
| Releases the objects in the pool, last first. More... | |
| (size_t) | - count |
| Returns the number of times objects have been added to the pool since it was last drained. | |
Instance Methods inherited from NXObject | |
| (void) | - dealloc |
| Frees the instance. More... | |
| (NXZone *) | - zone |
| Returns the zone in which the instance was allocated. More... | |
| (id) | - retain |
| Increases the retain count of the receiver. More... | |
| (void) | - release |
| Decreases the retain count of the receiver. More... | |
| (id) | - autorelease |
| Releases the receiver later, when the current autorelease pool of the thread is drained. More... | |
| (id) | - copy |
| Returns a copy which can't be changed by anything else, which the caller owns and has to release. More... | |
| (uintptr_t) | - hash |
| Returns a number for the object, which is the same for objects which are equal by isEqual:. More... | |
| (NXString *) | - description |
| Returns a string which describes the instance, for logging. More... | |
Instance Methods inherited from Object | |
| (id) | - init |
| Initialize the instance, after allocation. More... | |
| (Class) | - class |
| Returns the class of the instance. More... | |
| (Class) | - superclass |
| Returns the superclass of the instance. More... | |
| (BOOL) | - isEqual: |
| Compares the receiver to another object for equality. More... | |
| (BOOL) | - isKindOfClass: |
| Returns a Boolean value that indicates whether the receiver is an instance of a given class. More... | |
| (BOOL) | - conformsTo: |
| Checks if the receiver's class conforms to a protocol. More... | |
Instance Methods inherited from <ObjectProtocol> | |
| (BOOL) | - respondsToSelector: |
| Checks if the receiver responds to a selector. More... | |
Class Methods | |
| (NXAutoreleasePool *) | + currentPool |
| Returns the current pool of the calling thread. More... | |
Class Methods inherited from NXObject | |
| (id) | + alloc |
| Allocates a new instance in the default zone, or if there isn't one, with sys_calloc(). More... | |
| (id) | + allocWithZone: |
| Allocates a new instance in a specific zone. More... | |
| (id) | + new |
| Allocates and initializes a new instance, as [[cls alloc] init] does. More... | |
| (NXString *) | + description |
| Returns the name of the class. | |
Class Methods inherited from Object | |
| (void) | + initialize |
| Performs one-time initialization for the class. More... | |
| (Class) | + class |
| Returns the class object. More... | |
| (Class) | + superclass |
| Returns the superclass of the class. More... | |
| (const char *) | + name |
| Returns the name of the class. More... | |
| (BOOL) | + conformsTo: |
| Checks if the class conforms to a protocol. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Object | |
| Class | isa |
| A pointer to the object's class structure. More... | |
A pool of objects, which are released when the pool is drained.
A new pool becomes the current pool of the thread which initializes it, and autorelease adds objects to the current pool of the thread which calls it. When the pool is released, its objects are released, and the pool that was current before it is so again. Pools have to be released by the thread which initialized them, in the opposite order.
An object can be in a pool more than once, and is released as many times.
Pools can't be used from an interrupt handler.
Definition at line 25 of file NXAutoreleasePool.h.
| - (void) addObject: | (id) | object |
Adds an object to the pool.
It isn't retained, so the pool takes over a reference to it.
| object | The object, which can't be a pool. Nothing is done if it's nil. |
This can only be called by the thread which initialized the pool.
| + (NXAutoreleasePool *) currentPool |
Returns the current pool of the calling thread.
| - (void) drain |
Releases the objects in the pool, last first.
The pool can still be used.