MovingBuffer

A buffer that relies on moving chunks of data in memory to ensure that contiguous slices of any requested size can always be provided.

Constructors

this
this(Allocator allocator, size_t initialSize)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

alloc
T[] alloc(size_t n)

Allocates space for at least n new objects of type T to be written to the buffer.

commit
void commit(size_t n)

Adds first n objects of type T stored in the slice previously obtained using alloc. Does not touch the remaining part of that slice.

consume
void consume(size_t n)

Removes first n objects of type T from the buffer.

opAssign
void opAssign(MovingBuffer rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
peek
const(T)[] peek()

Returns a read-only slice, typed as const(T)[], containing all data currently available in the buffer.

Parameters

Allocator

_Allocator used for internal storage allocation.

Meta