vibe.d beta banner
get vibe.d
0.10.0

Asynchronous I/O that doesn’t get in your way, written in D

Struct FixedRingBuffer

struct FixedRingBuffer(T, ulong N = 0, bool INITIALIZE = true) ;

Constructors

NameDescription
this (capacity)

Fields

NameTypeDescription
m_buffer T[N]
m_fill size_t
m_start size_t

Properties

NameTypeDescription
back[get] inout(T)
capacity[get] size_t
capacity[set] size_t
empty[get] bool
freeSpace[get] size_t
front[get] inout(T)
full[get] bool
length[get] size_t

Methods

NameDescription
clear ()
dispose () Resets the capacity to zero and explicitly frees the memory for the buffer.
mod (n)
opApply (del)
opApply (del) iterate through elements with index
opDollar ()
opIndex (idx)
opSlice ()
opSlice (from, to)
peek ()
peekDst ()
popBack ()
popBackN (n)
popFront ()
popFrontN (n)
putBack (itm)
putBack (itms)
putBackN (n)
putFront (itm)
read (dst)
removeAt (r)

Inner structs

NameDescription
Range

Aliases

NameDescription
put
putN

TODO

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

Authors

Sönke Ludwig

Copyright

© 2012 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.