GATE
Loading...
Searching...
No Matches
gate_slotlist_class Struct Reference

A linear changable field of pointers to changable items of the same types. More...

#include <arrays.h>

Data Fields

void ** data_ptr
 
gate_size_t item_size
 
gate_size_t item_count
 
gate_size_t item_capacity
 
gate_mem_copyctor_t construct_item
 
gate_mem_dtor_t destruct_item
 

Detailed Description

A linear changable field of pointers to changable items of the same types.

A new item is copied into a separate memory space and a pointer to it is added to the slotlist array. Such pointer arrays are manipulated faster than arraylists as they only need to move pointers instead of copying whole objects, but they have a higher memory overhead. New added items are inserted in the next free position. If an item is removed at a specific position, the next added item takes that free position.

Field Documentation

◆ data_ptr

void** data_ptr

pointer to first item in slot-list

◆ item_size

gate_size_t item_size

size of one item in bytes

◆ item_count

gate_size_t item_count

amount of valid items in array

◆ item_capacity

gate_size_t item_capacity

amount of possible items in allocated array space

◆ construct_item

gate_mem_copyctor_t construct_item

copy-constructor function of a single item

◆ destruct_item

gate_mem_dtor_t destruct_item

destructor function of a single item


The documentation for this struct was generated from the following file: