Cogs.Core
Public Attributes | List of all members
GumboVector Struct Reference

#include <gumbo.h>

Public Attributes

void ** data
 
unsigned int length
 
unsigned int capacity
 

Detailed Description

A simple vector implementation. This stores a pointer to a data array and a length. All elements are stored as void*; client code must cast to the appropriate type. Overflows upon addition result in reallocation of the data array, with the size doubling to maintain O(1) amortized cost. There is no removal function, as this isn't needed for any of the operations within this library. Iteration can be done through inspecting the structure directly in a for-loop.

Definition at line 124 of file gumbo.h.

Member Data Documentation

◆ capacity

unsigned int GumboVector::capacity

Current array capacity.

Definition at line 134 of file gumbo.h.

◆ data

void** GumboVector::data

Data elements. This points to a dynamically-allocated array of capacity elements, each a void* to the element itself.

Definition at line 128 of file gumbo.h.

◆ length

unsigned int GumboVector::length

Number of elements currently in the vector.

Definition at line 131 of file gumbo.h.


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