|
Muvicado HD
|
Similar to NSMutableArray, but thread-safe. Internally, uses an NSMutableArray and a rwlock. More...
#include <MutLockArray.h>


Instance Methods | |
| (id) | - initWithCapacity: |
| Inits and returns a MutLockArray with a given capacity; the capacity may be 0. | |
| (id) | - init |
| (void) | - rdlock |
| Establishes a read-lock for the array; multiple read locks may exist simultaneously (if it's not changing, anything can look at the contents of the array). This method does not return until it has been able to get the lock. | |
| (void) | - wrlock |
| Establishes a write-lock for the array. Only one write-lock may exist at any given time, and all read-locks must be relinquished before the write-lock may be established (if you're going to change the array, nothing else can be changing or observing it). | |
| (void) | - unlock |
| Unlocks the array. | |
| (NSMutableArray *) | - array |
| Returns the NSMutableArray with everything in it. This returns the actual array, so be careful- it's possible to do something which ISN'T threadsafe with this... | |
| (NSMutableArray *) | - createArrayCopy |
| Returns an NSMutableArray which was created by calling "mutableCopy" on my array. Again, it's possible to do something which ISN'T threadsafe by calling this... | |
| (NSMutableArray *) | - lockCreateArrayCopy |
| Returns an NSMutableArray which was created while a read-lock was established; this is threadsafe. | |
| (void) | - addObject: |
| Calls "addObject" on my array; not threadsafe. | |
| (void) | - lockAddObject: |
| Establishes a write-lock, then calls "addObject" on self; threadsafe. | |
| (void) | - addObjectsFromArray: |
| Calls "addObjectsFromArray" on my array; not threadsafe. | |
| (void) | - lockAddObjectsFromArray: |
| Establishes a write-lock, then calls "addObjectsFromArray" on self; threadsafe. | |
| (void) | - replaceWithObjectsFromArray: |
| Calls "addObjectsFromArray" on my array; not threadsafe. | |
| (void) | - lockReplaceWithObjectsFromArray: |
| Establishes a write-lock, then calls "replaceWithObjectsFromArray" on self; threadsafe. | |
| (void) | - insertObject:atIndex: |
| Calls "insertObject:atIndex:" on my array; not threadsafe. | |
| (void) | - lockInsertObject:atIndex: |
| Establishes a write-lock, then calls "insertObject:atIndex:" on self; threadsafe. | |
| (void) | - removeAllObjects |
| Calls "removeAllObjects" on my array; not threadsafe. | |
| (void) | - lockRemoveAllObjects |
| Establishes a write-lock, then calls "removeAllObjects" on self; threadsafe. | |
| (id) | - firstObject |
| Calls "objectAtIndex:0" on my array; not threadsafe. | |
| (id) | - lockFirstObject |
| Establishes a read-lock, then calls "firstObject" on self; threadsafe. | |
| (void) | - removeFirstObject |
| Calls "removeObjectAtIndex:0" on my array; not threadsafe. | |
| (void) | - lockRemoveFirstObject |
| Establishes a write-lock, then calls "removeFirstObject" on self; threadsafe. | |
| (id) | - lastObject |
| Calls "lastObject" on my array; not threadsafe. | |
| (id) | - lockLastObject |
| Establishes a read-lock, then calls "lastObject" on self; threadsafe. | |
| (void) | - removeLastObject |
| Calls "removeLastObject" on my array; not threadsafe. | |
| (void) | - lockRemoveLastObject |
| Establishes a write-lock, then calls "removeLastObject" on self; threadsafe. | |
| (void) | - removeObject: |
| Calls "removeObject:" on my array; not threadsafe. | |
| (void) | - lockRemoveObject: |
| Establishes a write-lock, then calls "removeObject:" on self; threadsafe. | |
| (void) | - removeObjectAtIndex: |
| Calls "removeObjectAtIndex:" on my array; not threadsafe. | |
| (void) | - lockRemoveObjectAtIndex: |
| Establishes a write-lock, then calls "removeObjectAtIndex:" on self; threadsafe. | |
| (void) | - removeObjectsAtIndexes: |
| Calls "removeObjectsAtIndexes:" on my array; not threadsafe. | |
| (void) | - lockRemoveObjectsAtIndexes: |
| Establishes a write-lock, then calls "removeObjectsAtIndexes:" on self; threadsafe. | |
| (void) | - removeObjectsInArray: |
| Calls "removeObjectsInArray:" on my array; not threadsafe. | |
| (void) | - lockRemoveObjectsInArray: |
| Establishes a write-lock, then calls "removeObjectsInArray:" on self; threadsafe. | |
| (void) | - removeIdenticalPtrsInArray: |
| Calls "removeIdenticalPtrsInArray:" on my array; not threadsafe. | |
| (void) | - lockRemoveIdenticalPtrsInArray: |
| Establishes a write-lock, then calls "removeIdenticalPtrsInArray:" on self; threadsafe. | |
| (void) | - replaceObjectsAtIndexes:withObjects: |
| Calls "replaceObjectsAtIndexes:withObjects" on my array; not threadsafe. | |
| (void) | - lockReplaceObjectsAtIndexes:withObjects: |
| (id) | - valueForKey: |
| Calls "valueForKey:" on my array; not threadsafe. | |
| (id) | - lockValueForKey: |
| Establishes a read-lock, then calls "valueForKey:" on self; threadsafe. | |
| (BOOL) | - containsObject: |
| Calls "containsObject:" on my array; not threadsafe. | |
| (BOOL) | - lockContainsObject: |
| Establishes a read-lock, then calls "containsObject:" on self; threadsafe. | |
| (id) | - objectAtIndex: |
| Calls "objectAtIndex:" on my array; not threadsafe. | |
| (id) | - lockObjectAtIndex: |
| Establishes a read-lock, then calls "objectAtIndex:" on self; threadsafe. | |
| (NSArray *) | - objectsAtIndexes: |
| Calls "objectsAtIndexes:" on my array; not threadsafe. | |
| (NSArray *) | - lockObjectsAtIndexes: |
| Establishes a read-lock, then calls "objectsAtIndexes:" on self; threadsafe. | |
| (NSUInteger) | - indexOfObject: |
| Calls "indexOfObject:" on my array; not threadsafe. | |
| (NSUInteger) | - lockIndexOfObject: |
| Establishes a read-lock, then calls "indexOfObject:" on self; threadsafe. | |
| (BOOL) | - containsIdenticalPtr: |
| Enumerates through my array- compares the address of each item in the array to the passed pointer. Unlike NSMutableArray, this method does NOT call isEqualTo:, it's just a simple == operator. | |
| (BOOL) | - lockContainsIdenticalPtr: |
| Establishes a read-lock, then calls "containsIdenticalPtr:" on self; threadsafe. | |
| (int) | - indexOfIdenticalPtr: |
| Enumerates through my array- compares the address of each item in the array to the passed pointer. Unlike NSMutableArray, this method does NOT call isEqualTo:, it's just a simple == operator. | |
| (int) | - lockIndexOfIdenticalPtr: |
| Establishes a read-lock, then calls "indexOfIdenticalPtr:" on self; threadsafe. | |
| (void) | - removeIdenticalPtr: |
| Locates an item in my array by enumerating through it and comparing the address of each item in the array to the passed ptr, and then deletes the matching item from the array; not threadsafe. | |
| (void) | - lockRemoveIdenticalPtr: |
| Establishes a write-lock, then calls "removeIdenticalPtr:" on self; threadsafe. | |
| (NSArray *) | - filteredArrayUsingPredicate: |
| (NSArray *) | - lockFilteredArrayUsingPredicate: |
| (void) | - makeObjectsPerformSelector: |
| Calls "makeObjectsPerformSelector:" on my array; not threadsafe. | |
| (void) | - lockMakeObjectsPerformSelector: |
| Establishes a read-lock, then calls "makeObjectsPerformSelector:" on self; threadsafe. | |
| (void) | - makeObjectsPerformSelector:withObject: |
| Calls "makeObjectsPerformSelector:withObject:" on my array; not threadsafe. | |
| (void) | - lockMakeObjectsPerformSelector:withObject: |
| Establishes a read-lock, then calls "makeObjectsPerformSelector:withObject:" on self; threadsafe. | |
| (void) | - sortUsingSelector: |
| Calls "sortUsingSelector:" on my array; not threadsafe. | |
| (void) | - lockSortUsingSelector: |
| Establishes a write-lock, then calls "sortUsingSelector:" on self; threadsafe. | |
| (void) | - sortUsingDescriptors: |
| Calls "sortUsingDescriptors:" on my array; not threadsafe. | |
| (void) | - lockSortUsingDescriptors: |
| Establishes a write-lock, then calls "sortUsingDescriptors:" on self; threadsafe. | |
| (NSEnumerator *) | - objectEnumerator |
| (NSEnumerator *) | - reverseObjectEnumerator |
| (NSUInteger) | - count |
| (NSUInteger) | - lockCount |
Class Methods | |
| (id) | + arrayWithCapacity: |
| Creates and returns an auto-released MutLockArray with a given capacity. The capacity may be 0. | |
Protected Attributes | |
| NSMutableArray * | array |
| pthread_rwlock_t | arrayLock |
Similar to NSMutableArray, but thread-safe. Internally, uses an NSMutableArray and a rwlock.
Definition at line 20 of file MutLockArray.h.
| - (void) addObject: | (id) | o |
Calls "addObject" on my array; not threadsafe.
Implemented in MutNRLockArray.
| - (void) addObjectsFromArray: | (id) | a |
Calls "addObjectsFromArray" on my array; not threadsafe.
Implemented in MutNRLockArray.
| - (NSMutableArray *) array |
Returns the NSMutableArray with everything in it. This returns the actual array, so be careful- it's possible to do something which ISN'T threadsafe with this...
| + (id) arrayWithCapacity: | (NSUInteger) | c |
Creates and returns an auto-released MutLockArray with a given capacity. The capacity may be 0.
Implemented in MutNRLockArray.
| - (BOOL) containsIdenticalPtr: | (id) | o |
Enumerates through my array- compares the address of each item in the array to the passed pointer. Unlike NSMutableArray, this method does NOT call isEqualTo:, it's just a simple == operator.
Implemented in MutNRLockArray.
| - (BOOL) containsObject: | (id) | o |
Calls "containsObject:" on my array; not threadsafe.
Implemented in MutNRLockArray.
| - (NSUInteger) count |


| - (NSMutableArray *) createArrayCopy |
Returns an NSMutableArray which was created by calling "mutableCopy" on my array. Again, it's possible to do something which ISN'T threadsafe by calling this...
Implemented in MutNRLockArray.


| - (NSArray *) filteredArrayUsingPredicate: | (NSPredicate *) | predicate |
| - (id) firstObject |
Calls "objectAtIndex:0" on my array; not threadsafe.


| - (int) indexOfIdenticalPtr: | (id) | o |
Enumerates through my array- compares the address of each item in the array to the passed pointer. Unlike NSMutableArray, this method does NOT call isEqualTo:, it's just a simple == operator.
Implemented in MutNRLockArray.
| - (NSUInteger) indexOfObject: | (id) | o |
Calls "indexOfObject:" on my array; not threadsafe.
Implemented in MutNRLockArray.
| - (id) init |


| - (id) initWithCapacity: | (NSUInteger) | c |
Inits and returns a MutLockArray with a given capacity; the capacity may be 0.
| - (void) insertObject: | (id) | o | |
| atIndex: | (NSUInteger) | i |
Calls "insertObject:atIndex:" on my array; not threadsafe.
Implemented in MutNRLockArray.
| - (id) lastObject |
Calls "lastObject" on my array; not threadsafe.
Implemented in MutNRLockArray.


| - (void) lockAddObject: | (id) | o |
Establishes a write-lock, then calls "addObject" on self; threadsafe.
| - (void) lockAddObjectsFromArray: | (id) | a |
Establishes a write-lock, then calls "addObjectsFromArray" on self; threadsafe.
| - (BOOL) lockContainsIdenticalPtr: | (id) | o |
Establishes a read-lock, then calls "containsIdenticalPtr:" on self; threadsafe.
| - (BOOL) lockContainsObject: | (id) | o |
Establishes a read-lock, then calls "containsObject:" on self; threadsafe.
| - (NSUInteger) lockCount |


| - (NSMutableArray *) lockCreateArrayCopy |
Returns an NSMutableArray which was created while a read-lock was established; this is threadsafe.


| - (NSArray *) lockFilteredArrayUsingPredicate: | (NSPredicate *) | predicate |
| - (id) lockFirstObject |
Establishes a read-lock, then calls "firstObject" on self; threadsafe.


| - (int) lockIndexOfIdenticalPtr: | (id) | o |
Establishes a read-lock, then calls "indexOfIdenticalPtr:" on self; threadsafe.
| - (NSUInteger) lockIndexOfObject: | (id) | o |
Establishes a read-lock, then calls "indexOfObject:" on self; threadsafe.
| - (void) lockInsertObject: | (id) | o | |
| atIndex: | (NSUInteger) | i |
Establishes a write-lock, then calls "insertObject:atIndex:" on self; threadsafe.
| - (id) lockLastObject |
Establishes a read-lock, then calls "lastObject" on self; threadsafe.


| - (void) lockMakeObjectsPerformSelector: | (SEL) | s |
Establishes a read-lock, then calls "makeObjectsPerformSelector:" on self; threadsafe.
| - (void) lockMakeObjectsPerformSelector: | (SEL) | s | |
| withObject: | (id) | o |
Establishes a read-lock, then calls "makeObjectsPerformSelector:withObject:" on self; threadsafe.
| - (id) lockObjectAtIndex: | (NSUInteger) | i |
Establishes a read-lock, then calls "objectAtIndex:" on self; threadsafe.
| - (NSArray *) lockObjectsAtIndexes: | (NSIndexSet *) | indexes |
Establishes a read-lock, then calls "objectsAtIndexes:" on self; threadsafe.
| - (void) lockRemoveAllObjects |
Establishes a write-lock, then calls "removeAllObjects" on self; threadsafe.


| - (void) lockRemoveFirstObject |
Establishes a write-lock, then calls "removeFirstObject" on self; threadsafe.


| - (void) lockRemoveIdenticalPtr: | (id) | o |
Establishes a write-lock, then calls "removeIdenticalPtr:" on self; threadsafe.
| - (void) lockRemoveIdenticalPtrsInArray: | (NSArray *) | a |
Establishes a write-lock, then calls "removeIdenticalPtrsInArray:" on self; threadsafe.
| - (void) lockRemoveLastObject |
Establishes a write-lock, then calls "removeLastObject" on self; threadsafe.


| - (void) lockRemoveObject: | (id) | o |
Establishes a write-lock, then calls "removeObject:" on self; threadsafe.
| - (void) lockRemoveObjectAtIndex: | (NSUInteger) | i |
Establishes a write-lock, then calls "removeObjectAtIndex:" on self; threadsafe.
| - (void) lockRemoveObjectsAtIndexes: | (NSIndexSet *) | i |
Establishes a write-lock, then calls "removeObjectsAtIndexes:" on self; threadsafe.
| - (void) lockRemoveObjectsInArray: | (NSArray *) | otherArray |
Establishes a write-lock, then calls "removeObjectsInArray:" on self; threadsafe.
| - (void) lockReplaceObjectsAtIndexes: | (NSIndexSet *) | indexes | |
| withObjects: | (NSArray *) | objects |
| - (void) lockReplaceWithObjectsFromArray: | (id) | a |
Establishes a write-lock, then calls "replaceWithObjectsFromArray" on self; threadsafe.
| - (void) lockSortUsingDescriptors: | (NSArray *) | descriptors |
Establishes a write-lock, then calls "sortUsingDescriptors:" on self; threadsafe.
| - (void) lockSortUsingSelector: | (SEL) | s |
Establishes a write-lock, then calls "sortUsingSelector:" on self; threadsafe.
| - (id) lockValueForKey: | (NSString *) | key |
Establishes a read-lock, then calls "valueForKey:" on self; threadsafe.
| - (void) makeObjectsPerformSelector: | (SEL) | s |
Calls "makeObjectsPerformSelector:" on my array; not threadsafe.
| - (void) makeObjectsPerformSelector: | (SEL) | s | |
| withObject: | (id) | o |
Calls "makeObjectsPerformSelector:withObject:" on my array; not threadsafe.
| - (id) objectAtIndex: | (NSUInteger) | i |
Calls "objectAtIndex:" on my array; not threadsafe.
Implemented in MutNRLockArray.
| - (NSEnumerator *) objectEnumerator |


| - (NSArray *) objectsAtIndexes: | (NSIndexSet *) | indexes |
Calls "objectsAtIndexes:" on my array; not threadsafe.
Implemented in MutNRLockArray.
| - (void) rdlock |
Establishes a read-lock for the array; multiple read locks may exist simultaneously (if it's not changing, anything can look at the contents of the array). This method does not return until it has been able to get the lock.


| - (void) removeAllObjects |
Calls "removeAllObjects" on my array; not threadsafe.


| - (void) removeFirstObject |
Calls "removeObjectAtIndex:0" on my array; not threadsafe.


| - (void) removeIdenticalPtr: | (id) | o |
Locates an item in my array by enumerating through it and comparing the address of each item in the array to the passed ptr, and then deletes the matching item from the array; not threadsafe.
Implemented in MutNRLockArray.
| - (void) removeIdenticalPtrsInArray: | (NSArray *) | a |
Calls "removeIdenticalPtrsInArray:" on my array; not threadsafe.
| - (void) removeLastObject |
Calls "removeLastObject" on my array; not threadsafe.


| - (void) removeObject: | (id) | o |
Calls "removeObject:" on my array; not threadsafe.
Implemented in MutNRLockArray.
| - (void) removeObjectAtIndex: | (NSUInteger) | i |
Calls "removeObjectAtIndex:" on my array; not threadsafe.
| - (void) removeObjectsAtIndexes: | (NSIndexSet *) | i |
Calls "removeObjectsAtIndexes:" on my array; not threadsafe.
| - (void) removeObjectsInArray: | (NSArray *) | otherArray |
Calls "removeObjectsInArray:" on my array; not threadsafe.
| - (void) replaceObjectsAtIndexes: | (NSIndexSet *) | indexes | |
| withObjects: | (NSArray *) | objects |
Calls "replaceObjectsAtIndexes:withObjects" on my array; not threadsafe.
| - (void) replaceWithObjectsFromArray: | (id) | a |
Calls "addObjectsFromArray" on my array; not threadsafe.
Implemented in MutNRLockArray.
| - (NSEnumerator *) reverseObjectEnumerator |


| - (void) sortUsingDescriptors: | (NSArray *) | descriptors |
Calls "sortUsingDescriptors:" on my array; not threadsafe.
| - (void) sortUsingSelector: | (SEL) | s |
Calls "sortUsingSelector:" on my array; not threadsafe.
| - (void) unlock |
Unlocks the array.


| - (id) valueForKey: | (NSString *) | key |
Calls "valueForKey:" on my array; not threadsafe.
| - (void) wrlock |
Establishes a write-lock for the array. Only one write-lock may exist at any given time, and all read-locks must be relinquished before the write-lock may be established (if you're going to change the array, nothing else can be changing or observing it).


|
protected |
Definition at line 21 of file MutLockArray.h.
|
protected |
Definition at line 22 of file MutLockArray.h.