|
cocos2d for iPhone 1.0.0
2D engine for iOS and OS X
|
#import <Foundation/Foundation.h>#import <stdlib.h>#import <string.h>

Go to the source code of this file.
Functions | |
| static ccArray * | ccArrayNew (NSUInteger capacity) |
| static void | ccArrayRemoveAllObjects (ccArray *arr) |
| static void | ccArrayFree (ccArray *arr) |
| static void | ccArrayDoubleCapacity (ccArray *arr) |
| static void | ccArrayEnsureExtraCapacity (ccArray *arr, NSUInteger extra) |
| static void | ccArrayShrink (ccArray *arr) |
| static NSUInteger | ccArrayGetIndexOfObject (ccArray *arr, id object) |
| static BOOL | ccArrayContainsObject (ccArray *arr, id object) |
| static void | ccArrayAppendObject (ccArray *arr, id object) |
| static void | ccArrayAppendObjectWithResize (ccArray *arr, id object) |
| static void | ccArrayAppendArray (ccArray *arr, ccArray *plusArr) |
| static void | ccArrayAppendArrayWithResize (ccArray *arr, ccArray *plusArr) |
| static void | ccArrayInsertObjectAtIndex (ccArray *arr, id object, NSUInteger index) |
| static void | ccArraySwapObjectsAtIndexes (ccArray *arr, NSUInteger index1, NSUInteger index2) |
| static void | ccArrayRemoveObjectAtIndex (ccArray *arr, NSUInteger index) |
| static void | ccArrayFastRemoveObjectAtIndex (ccArray *arr, NSUInteger index) |
| static void | ccArrayRemoveObject (ccArray *arr, id object) |
| static void | ccArrayRemoveArray (ccArray *arr, ccArray *minusArr) |
| static void | ccArrayFullRemoveArray (ccArray *arr, ccArray *minusArr) |
| static void | ccArrayMakeObjectsPerformSelector (ccArray *arr, SEL sel) |
| static void | ccCArrayRemoveAllValues (ccCArray *arr) |
| static ccCArray * | ccCArrayNew (NSUInteger capacity) |
| static void | ccCArrayFree (ccCArray *arr) |
| static void | ccCArrayDoubleCapacity (ccCArray *arr) |
| static void | ccCArrayEnsureExtraCapacity (ccCArray *arr, NSUInteger extra) |
| static NSUInteger | ccCArrayGetIndexOfValue (ccCArray *arr, void *value) |
| static BOOL | ccCArrayContainsValue (ccCArray *arr, void *value) |
| static void | ccCArrayInsertValueAtIndex (ccCArray *arr, void *value, NSUInteger index) |
| static void | ccCArrayAppendValue (ccCArray *arr, void *value) |
| static void | ccCArrayAppendValueWithResize (ccCArray *arr, void *value) |
| static void | ccCArrayAppendArray (ccCArray *arr, ccCArray *plusArr) |
| static void | ccCArrayAppendArrayWithResize (ccCArray *arr, ccCArray *plusArr) |
| static void | ccCArrayRemoveValueAtIndex (ccCArray *arr, NSUInteger index) |
| static void | ccCArrayFastRemoveValueAtIndex (ccCArray *arr, NSUInteger index) |
| static void | ccCArrayRemoveValue (ccCArray *arr, void *value) |
| static void | ccCArrayRemoveArray (ccCArray *arr, ccCArray *minusArr) |
| static void | ccCArrayFullRemoveArray (ccCArray *arr, ccCArray *minusArr) |
Based on Chipmunk cpArray. ccArray is a faster alternative to NSMutableArray, it does pretty much the same thing (stores NSObjects and retains/releases them appropriately). It's faster because:
There are 2 kind of functions:
Definition in file ccCArray.h.
| static void ccArrayAppendArray | ( | ccArray * | arr, |
| ccArray * | plusArr | ||
| ) | [inline, static] |
Appends objects from plusArr to arr. Behaviour undefined if arr doesn't have enough capacity.
Definition at line 158 of file ccCArray.h.
| static void ccArrayAppendArrayWithResize | ( | ccArray * | arr, |
| ccArray * | plusArr | ||
| ) | [inline, static] |
Appends objects from plusArr to arr. Capacity of arr is increased if needed.
Definition at line 165 of file ccCArray.h.
| static void ccArrayAppendObject | ( | ccArray * | arr, |
| id | object | ||
| ) | [inline, static] |
Appends an object. Bahaviour undefined if array doesn't have enough capacity.
Definition at line 143 of file ccCArray.h.
| static void ccArrayAppendObjectWithResize | ( | ccArray * | arr, |
| id | object | ||
| ) | [inline, static] |
Appends an object. Capacity of arr is increased if needed.
Definition at line 150 of file ccCArray.h.
| static BOOL ccArrayContainsObject | ( | ccArray * | arr, |
| id | object | ||
| ) | [inline, static] |
Returns a Boolean value that indicates whether object is present in array.
Definition at line 137 of file ccCArray.h.
| static void ccArrayDoubleCapacity | ( | ccArray * | arr | ) | [inline, static] |
Doubles array capacity
Definition at line 87 of file ccCArray.h.
| static void ccArrayEnsureExtraCapacity | ( | ccArray * | arr, |
| NSUInteger | extra | ||
| ) | [inline, static] |
Increases array capacity such that max >= num + extra.
Definition at line 97 of file ccCArray.h.
| static void ccArrayFastRemoveObjectAtIndex | ( | ccArray * | arr, |
| NSUInteger | index | ||
| ) | [inline, static] |
Removes object at specified index and fills the gap with the last object, thereby avoiding the need to push back subsequent objects. Behaviour undefined if index outside [0, num-1].
Definition at line 220 of file ccCArray.h.
| static void ccArrayFree | ( | ccArray * | arr | ) | [inline, static] |
Frees array after removing all remaining objects. Silently ignores nil arr.
Definition at line 76 of file ccCArray.h.
| static void ccArrayFullRemoveArray | ( | ccArray * | arr, |
| ccArray * | minusArr | ||
| ) | [inline, static] |
Removes from arr all objects in minusArr. For each object in minusArr, all matching instances in arr will be removed.
Definition at line 253 of file ccCArray.h.
| static NSUInteger ccArrayGetIndexOfObject | ( | ccArray * | arr, |
| id | object | ||
| ) | [inline, static] |
Returns index of first occurence of object, NSNotFound if object not found.
Definition at line 128 of file ccCArray.h.
| static void ccArrayInsertObjectAtIndex | ( | ccArray * | arr, |
| id | object, | ||
| NSUInteger | index | ||
| ) | [inline, static] |
Inserts an object at index
Definition at line 172 of file ccCArray.h.
| static void ccArrayMakeObjectsPerformSelector | ( | ccArray * | arr, |
| SEL | sel | ||
| ) | [inline, static] |
Sends to each object in arr the message identified by given selector.
Definition at line 269 of file ccCArray.h.
| static ccArray* ccArrayNew | ( | NSUInteger | capacity | ) | [inline, static] |
Allocates and initializes a new array with specified capacity
Definition at line 61 of file ccCArray.h.
| static void ccArrayRemoveAllObjects | ( | ccArray * | arr | ) | [inline, static] |
Removes all objects from arr
Definition at line 199 of file ccCArray.h.
| static void ccArrayRemoveArray | ( | ccArray * | arr, |
| ccArray * | minusArr | ||
| ) | [inline, static] |
Removes from arr all objects in minusArr. For each object in minusArr, the first matching instance in arr will be removed.
Definition at line 245 of file ccCArray.h.
| static void ccArrayRemoveObject | ( | ccArray * | arr, |
| id | object | ||
| ) | [inline, static] |
Searches for the first occurance of object and removes it. If object is not found the function has no effect.
Definition at line 236 of file ccCArray.h.
| static void ccArrayRemoveObjectAtIndex | ( | ccArray * | arr, |
| NSUInteger | index | ||
| ) | [inline, static] |
Removes object at specified index and pushes back all subsequent objects. Behaviour undefined if index outside [0, num-1].
Definition at line 207 of file ccCArray.h.
| static void ccArrayShrink | ( | ccArray * | arr | ) | [inline, static] |
shrinks the array so the memory footprint corresponds with the number of items
Definition at line 104 of file ccCArray.h.
| static void ccArraySwapObjectsAtIndexes | ( | ccArray * | arr, |
| NSUInteger | index1, | ||
| NSUInteger | index2 | ||
| ) | [inline, static] |
Swaps two objects
Definition at line 187 of file ccCArray.h.
| static void ccCArrayAppendArray | ( | ccCArray * | arr, |
| ccCArray * | plusArr | ||
| ) | [inline, static] |
Appends values from plusArr to arr. Behaviour undefined if arr doesn't have enough capacity.
Definition at line 372 of file ccCArray.h.
| static void ccCArrayAppendArrayWithResize | ( | ccCArray * | arr, |
| ccCArray * | plusArr | ||
| ) | [inline, static] |
Appends values from plusArr to arr. Capacity of arr is increased if needed.
Definition at line 379 of file ccCArray.h.
| static void ccCArrayAppendValue | ( | ccCArray * | arr, |
| void * | value | ||
| ) | [inline, static] |
Appends an value. Bahaviour undefined if array doesn't have enough capacity.
Definition at line 357 of file ccCArray.h.
| static void ccCArrayAppendValueWithResize | ( | ccCArray * | arr, |
| void * | value | ||
| ) | [inline, static] |
Appends an value. Capacity of arr is increased if needed.
Definition at line 364 of file ccCArray.h.
| static BOOL ccCArrayContainsValue | ( | ccCArray * | arr, |
| void * | value | ||
| ) | [inline, static] |
Returns a Boolean value that indicates whether value is present in the C array.
Definition at line 334 of file ccCArray.h.
| static void ccCArrayDoubleCapacity | ( | ccCArray * | arr | ) | [inline, static] |
Doubles C array capacity
Definition at line 314 of file ccCArray.h.
| static void ccCArrayEnsureExtraCapacity | ( | ccCArray * | arr, |
| NSUInteger | extra | ||
| ) | [inline, static] |
Increases array capacity such that max >= num + extra.
Definition at line 320 of file ccCArray.h.
| static void ccCArrayFastRemoveValueAtIndex | ( | ccCArray * | arr, |
| NSUInteger | index | ||
| ) | [inline, static] |
Removes value at specified index and fills the gap with the last value, thereby avoiding the need to push back subsequent values. Behaviour undefined if index outside [0, num-1].
Definition at line 406 of file ccCArray.h.
| static void ccCArrayFree | ( | ccCArray * | arr | ) | [inline, static] |
Frees C array after removing all remaining values. Silently ignores nil arr.
Definition at line 303 of file ccCArray.h.
| static void ccCArrayFullRemoveArray | ( | ccCArray * | arr, |
| ccCArray * | minusArr | ||
| ) | [inline, static] |
Removes from arr all values in minusArr. For each value in minusArr, all matching instances in arr will be removed.
Definition at line 434 of file ccCArray.h.
| static NSUInteger ccCArrayGetIndexOfValue | ( | ccCArray * | arr, |
| void * | value | ||
| ) | [inline, static] |
Returns index of first occurence of value, NSNotFound if value not found.
Definition at line 326 of file ccCArray.h.
| static void ccCArrayInsertValueAtIndex | ( | ccCArray * | arr, |
| void * | value, | ||
| NSUInteger | index | ||
| ) | [inline, static] |
Inserts a value at a certain position. Behaviour undefined if aray doesn't have enough capacity
Definition at line 340 of file ccCArray.h.
| static ccCArray* ccCArrayNew | ( | NSUInteger | capacity | ) | [inline, static] |
Allocates and initializes a new C array with specified capacity
Definition at line 290 of file ccCArray.h.
| static void ccCArrayRemoveAllValues | ( | ccCArray * | arr | ) | [inline, static] |
Removes all values from arr
Definition at line 386 of file ccCArray.h.
| static void ccCArrayRemoveArray | ( | ccCArray * | arr, |
| ccCArray * | minusArr | ||
| ) | [inline, static] |
Removes from arr all values in minusArr. For each Value in minusArr, the first matching instance in arr will be removed.
Definition at line 425 of file ccCArray.h.
| static void ccCArrayRemoveValue | ( | ccCArray * | arr, |
| void * | value | ||
| ) | [inline, static] |
Searches for the first occurance of value and removes it. If value is not found the function has no effect.
Definition at line 415 of file ccCArray.h.
| static void ccCArrayRemoveValueAtIndex | ( | ccCArray * | arr, |
| NSUInteger | index | ||
| ) | [inline, static] |
Removes value at specified index and pushes back all subsequent values. Behaviour undefined if index outside [0, num-1].
Definition at line 395 of file ccCArray.h.