![]() |
Spicy
|
#include <stream.h>
Public Types | |
using | SafeConstIterator = stream::SafeConstIterator |
using | UnsafeConstIterator = stream::detail::UnsafeConstIterator |
using | Size = stream::Size |
Public Member Functions | |
Chain (std::unique_ptr< Chunk > head) | |
Chain (Chain &&other)=delete | |
Chain (const Chain &other)=delete | |
Chain & | operator= (const Chain &other)=delete |
Chain & | operator= (const Chain &&other)=delete |
const Chunk * | head () const |
const Chunk * | tail () const |
Size | size () const |
bool | isFrozen () const |
bool | isValid () const |
bool | inRange (Offset o) const |
Offset | offset () const |
Offset | endOffset () const |
const Chunk * | findChunk (Offset offset, const Chunk *hint_prev=nullptr) const |
Chunk * | findChunk (Offset offset, Chunk *hint_prev=nullptr) |
const Byte * | data (Offset offset, Chunk *hint_prev=nullptr) const |
SafeConstIterator | begin () const |
SafeConstIterator | end () const |
SafeConstIterator | at (Offset offset) const |
UnsafeConstIterator | unsafeBegin () const |
UnsafeConstIterator | unsafeEnd () const |
ChainPtr | deepCopy () const |
void | append (std::unique_ptr< Chunk > chunk) |
void | append (Chain &&other) |
void | trim (Offset offset) |
void | trim (const SafeConstIterator &i) |
void | trim (const UnsafeConstIterator &i) |
void | invalidate () |
void | reset () |
void | freeze () |
void | unfreeze () |
int | numberOfChunks () const |
Main data structure for the content of a stream object. A chain is heap-allocated by the stream and retains ownership of the linked chunks. A Chain may survive its stream in the case that iterators to any of its chunks are still around.
|
inline |
Moves a chunk and all its successors into a new chain.
void Chain::append | ( | std::unique_ptr< Chunk > | chunk | ) |
Appends a new chunk to the end.