29typedef void SimpleArrayData;
30typedef void SimpleArrayElement;
32typedef void (*SimpleArrayInit)(SimpleArrayElement* elem);
33typedef void (*SimpleArrayReset)(SimpleArrayElement* elem);
34typedef void (*SimpleArrayCopy)(SimpleArrayElement* elem,
const SimpleArrayElement* other);
41 const size_t type_size;
void simple_array_init(SimpleArray *instance, uint32_t count)
Initialise a SimpleArray instance by allocating additional space to contain the requested number of e...
Definition simple_array.c:24
const SimpleArrayElement * simple_array_cget(const SimpleArray *instance, uint32_t index)
Get a const pointer to an element contained in a SimpleArray instance.
Definition simple_array.c:107
void simple_array_free(SimpleArray *instance)
Free a SimpleArray instance and release its contents.
Definition simple_array.c:17
const SimpleArrayData * simple_array_cget_data(const SimpleArray *instance)
Get a constant pointer to the internal data of a SimpleArray instance.
Definition simple_array.c:119
SimpleArray * simple_array_alloc(const SimpleArrayConfig *config)
Allocate a SimpleArray instance with the given configuration.
Definition simple_array.c:11
void simple_array_reset(SimpleArray *instance)
Reset a SimpleArray instance and delete all of its elements.
Definition simple_array.c:41
void simple_array_copy(SimpleArray *instance, const SimpleArray *other)
Copy (duplicate) another SimpleArray instance to this one.
Definition simple_array.c:60
SimpleArrayElement * simple_array_get(SimpleArray *instance, uint32_t index)
Get a pointer to an element contained in a SimpleArray instance.
Definition simple_array.c:100
bool simple_array_is_equal(const SimpleArray *instance, const SimpleArray *other)
Check if another SimpleArray instance is equal (the same object or holds the same data) to this one.
Definition simple_array.c:83
uint32_t simple_array_get_count(const SimpleArray *instance)
Get the count of elements currently contained in a SimpleArray instance.
Definition simple_array.c:95
SimpleArrayData * simple_array_get_data(SimpleArray *instance)
Get a pointer to the internal data of a SimpleArray instance.
Definition simple_array.c:112
Simple Array configuration structure.
Definition simple_array.h:37
SimpleArrayCopy copy
Copy (custom copy-constructor) method.
Definition simple_array.h:40
SimpleArrayInit init
Initialisation (in-place constructor) method.
Definition simple_array.h:38
SimpleArrayReset reset
Reset (custom destructor) method.
Definition simple_array.h:39
Definition simple_array.c:5