Spicy
Public Types | Public Member Functions | List of all members
hilti::rt::stream::detail::Chain Class Reference

#include <stream.h>

Inheritance diagram for hilti::rt::stream::detail::Chain:
hilti::rt::intrusive_ptr::ManagedObject

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
 
Chainoperator= (const Chain &other)=delete
 
Chainoperator= (const Chain &&other)=delete
 
const Chunkhead () const
 
const Chunktail () const
 
Size size () const
 
bool isFrozen () const
 
bool isValid () const
 
bool inRange (const Offset &o) const
 
Offset offset () const
 
Offset endOffset () const
 
const ChunkfindChunk (const Offset &offset, const Chunk *hint_prev=nullptr) const
 
ChunkfindChunk (const Offset &offset, Chunk *hint_prev=nullptr)
 
const Byte * data (const Offset &offset, Chunk *hint_prev=nullptr) const
 
SafeConstIterator begin () const
 
SafeConstIterator end () const
 
SafeConstIterator at (const 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 (const Offset &offset)
 
void trim (const SafeConstIterator &i)
 
void trim (const UnsafeConstIterator &i)
 
void invalidate ()
 
void reset ()
 
void freeze ()
 
void unfreeze ()
 
int numberOfChunks () const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Chain()

hilti::rt::stream::detail::Chain::Chain ( std::unique_ptr< Chunk head)
inline

Moves a chunk and all its successors into a new chain.

Member Function Documentation

◆ append()

void Chain::append ( std::unique_ptr< Chunk chunk)

Appends a new chunk to the end.


The documentation for this class was generated from the following files: