A simple array implementation. More...
Public Member Functions | |
IA_CONSTRUCTOR void | IAArray_init (IAArray *, size_t size) |
void | IAArray_set (IAArray *, size_t index, void *object) |
void * | IAArray_get (const IAArray *, size_t index) |
void | IAArray_callFunctionOnAllObjects (const IAArray *, void(*function)(void *object)) |
static size_t | IAArray_getSize (const IAArray *this) |
IA_DESTRUCTOR void | IAArray_deinit (IAArray *) |
Data Fields | |
IAObject | base |
void ** | objects |
size_t | size |
A simple array implementation.
Can be used instead of typical c arrays as an object wrapper.
IA_CONSTRUCTOR void IAArray_init | ( | IAArray * | , |
size_t | size | ||
) |
Initializes the array.
size | The size of the array |
void IAArray_set | ( | IAArray * | , |
size_t | index, | ||
void * | object | ||
) |
Set an element at the specified index.
index | The index to set. Must be >= 0 and < size |
object | The object to set at the specified index |
void * IAArray_get | ( | const IAArray * | , |
size_t | index | ||
) |
Get an element at the specified index.
index | The index. Must be >= 0 and < size |
void IAArray_callFunctionOnAllObjects | ( | const IAArray * | , |
void(*)(void *object) | function | ||
) |
Calls the specified function on all objects in array and stops when reaching the first NULL value or end of array.
function | The function to call objects on. |
|
inline |
IA_DESTRUCTOR void IAArray_deinit | ( | IAArray * | ) |
Deinitialize the array.
IAObject IAArray::base |
void** IAArray::objects |
size_t IAArray::size |