ImpsEngine  1.0.0
A software library collection for end user applications.
IAArray Class Reference

A simple array implementation. More...

Inheritance diagram for IAArray:

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
 

Detailed Description

A simple array implementation.

Can be used instead of typical c arrays as an object wrapper.

Member Function Documentation

◆ IAArray_init()

IA_CONSTRUCTOR void IAArray_init ( IAArray ,
size_t  size 
)

Initializes the array.

Parameters
sizeThe size of the array

◆ IAArray_set()

void IAArray_set ( IAArray ,
size_t  index,
void *  object 
)

Set an element at the specified index.

Parameters
indexThe index to set. Must be >= 0 and < size
objectThe object to set at the specified index

◆ IAArray_get()

void * IAArray_get ( const IAArray ,
size_t  index 
)

Get an element at the specified index.

Parameters
indexThe index. Must be >= 0 and < size
Returns
The object at the specified index

◆ IAArray_callFunctionOnAllObjects()

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.

Parameters
functionThe function to call objects on.

◆ IAArray_getSize()

static size_t IAArray_getSize ( const IAArray this)
inline

◆ IAArray_deinit()

IA_DESTRUCTOR void IAArray_deinit ( IAArray )

Deinitialize the array.

Field Documentation

◆ base

IAObject IAArray::base

◆ objects

void** IAArray::objects

◆ size

size_t IAArray::size

The documentation for this class was generated from the following files: