Inherits from NSObject
Declared in CC3DataArray.h

Overview

CC3DataArray manages data as an array of structure elements.

Properties

elementCapacity

Indicates the number of elements, each of the size indicated by the elementSize property, that can be held in this data array.

@property (nonatomic, assign) NSUInteger elementCapacity

Discussion

Changing this property changes the value of the length property.

The initial value of this property is zero.

Declared In

CC3DataArray.h

elementSize

Indicates the size, in bytes, of each data element in this array.

@property (nonatomic, assign) NSUInteger elementSize

Discussion

In common use, an instance will contain an array of structs, and this value will indicate the size of the struct.

Changing this property changes the value of the length property.

This property cannot be set to zero.

The initial value of this property is 1, indicating that each element contains one byte.

Declared In

CC3DataArray.h

isReady

Indicates that the data is ready to be used.

@property (nonatomic, assign) BOOL isReady

Discussion

This property has no internal use. The application can use this property to indicate that this data array has been populated with data and is ready for use.

Declared In

CC3DataArray.h

Class Methods

dataArrayWithElementSize:

Allocates and initializes an autoreleased instance to hold an array of data elements, where each element will be of the specified size in bytes. The initial element capacity is zero. This can be extended via the elementCapacity property.

+ (id)dataArrayWithElementSize:(NSUInteger)elementSize

Declared In

CC3DataArray.h

Instance Methods

elementAt:

Returns a pointer to the element in this array at the specified index.

- (void *)elementAt:(NSUInteger)index

Discussion

The returned pointer will typically be cast to a structure whose size matches the elementSize property.

Declared In

CC3DataArray.h

ensureElementCapacity:

Ensures that this data array can hold at least the specified number of elements, each of the size indicated by the elementSize property.

- (void)ensureElementCapacity:(NSUInteger)elementCapacity

Discussion

If the specified element capacity is larger than the value returned by the elementCapacity property, the data array is expanded to the new capacity. if the specified element capacity is equal to or smaller than the value returned by teh elementCapacity property, no changes are made to the capacity of this data array.

Changing this property may change the value of the length property.

Declared In

CC3DataArray.h

initWithElementSize:

Initializes this instance to hold an array of data elements, where each element will be of the specified size in bytes. The initial element capacity is zero. This can be extended via the elementCapacity property.

- (id)initWithElementSize:(NSUInteger)elementSize

Declared In

CC3DataArray.h