vibe.utils.array

Utility functions for array processing

Types 5

keepData
freeData
reuseData
structAllocAppender(ArrayType : E[], E)
Fields
ElemType[] m_data
ElemType[] m_remaining
IAllocator m_alloc
bool m_allocatedBuffer
Methods
ArrayType data() @property
void reset(AppenderResetMode reset_mode = AppenderResetMode.keepData)
void reserve(size_t amount) @safeGrows the capacity of the internal buffer so that it can hold a minumum amount of elements.
void put(E el) @safe
void put(scope ArrayType arr) @safe
void grow(size_t min_free) @safe
private auto withAlloc(string method, ARGS...)(auto ref ARGS args)
Constructors
this(IAllocator alloc, ElemType[] initial_buffer = null)
structFixedAppender(ArrayType : E[], size_t NELEM, E)
Fields
ElemType[NELEM] m_data
size_t m_fill
Methods
void clear()
void put(E el)
void put(ArrayType arr)
ArrayType data() @property
structFixedRingBuffer(T, size_t N = 0, bool INITIALIZE = true)
deprecated Use `vibe.container.ringbuffer.RingBuffer` instead.

TODO: clear ring buffer fields upon removal (to run struct destructors, if T is a struct)

Fields
size_t m_start
size_t m_fill
Methods
bool empty() @property const
bool full() @property const
size_t length() @property const
size_t freeSpace() @property const
size_t capacity() @property const
inout(T) front() @property ref inout
inout(T) back() @property ref inout
void clear()
void putBack()(T itm)
void putBack(TC : T)(TC[] itms)
void putBackN(size_t n)
void putFront(T itm)
void popFront()
void popFrontN(size_t n)
void popBack()
void popBackN(size_t n)
void removeAt(Range r)
inout(T)[] peek() inout
T[] peekDst()
void read(T[] dst)
int opApply(scope int delegate(ref T itm) @safe del)
int opApply(scope int delegate(size_t i, ref T itm) @safe del)iterate through elements with index
inout(T) opIndex(size_t idx) ref inout
Range opSlice(size_t from, size_t to)
size_t opDollar(size_t dim)() if(dim == 0) const
private size_t mod(size_t n) const
Nested Templates
Range
structArraySet(Key)
deprecated
Fields
Key[4] m_staticEntries
Key[] m_entries
AllocatorType m_allocator
Methods
GenAllocator AW(GenAllocator a)
ArraySet dup() @property
void setAllocator(GenAllocator allocator)
bool opBinaryRight(string op)(Key key) if (op == "in")
int opApply(int delegate(ref Key) @safe del)
bool contains(Key key) const
void insert(Key key)
void remove(Key key)
ref allocator() nothrow @trusted
private bool isNull(GenAllocator a)
Destructors