Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::MemoryStream Class Reference
Inheritance diagram for duckdb::MemoryStream:
Collaboration diagram for duckdb::MemoryStream:

Public Member Functions

 MemoryStream (Allocator &allocator, idx_t capacity=DEFAULT_INITIAL_CAPACITY)
 
 MemoryStream (idx_t capacity=DEFAULT_INITIAL_CAPACITY)
 
 MemoryStream (data_ptr_t buffer, idx_t capacity)
 
 MemoryStream (const MemoryStream &)=delete
 Cant copy!
 
MemoryStreamoperator= (const MemoryStream &)=delete
 
 MemoryStream (MemoryStream &&other) noexcept
 
MemoryStreamoperator= (MemoryStream &&other) noexcept
 
void WriteData (const_data_ptr_t buffer, idx_t write_size) override
 
void GrowCapacity (idx_t write_size)
 
void ReadData (data_ptr_t buffer, idx_t read_size) override
 
void ReadData (QueryContext context, data_ptr_t buffer, idx_t read_size) override
 
void Rewind ()
 Rewind the stream to the start, keeping the capacity and the backing buffer intact.
 
void Release ()
 
data_ptr_t GetData () const
 Get a pointer to the underlying backing buffer.
 
idx_t GetPosition () const
 Get the current position in the stream.
 
idx_t GetCapacity () const
 Get the capacity of the stream.
 
void SetPosition (idx_t position)
 Set the position in the stream.
 
- Public Member Functions inherited from duckdb::WriteStream
template<class T >
void Write (T element)
 
- Public Member Functions inherited from duckdb::ReadStream
template<class T >
Read ()
 
template<class T >
Read (QueryContext context)
 

Static Public Attributes

static constexpr idx_t DEFAULT_INITIAL_CAPACITY = 512
 

Private Attributes

optional_ptr< Allocatorallocator
 
idx_t position
 
idx_t capacity
 
data_ptr_t data
 

Constructor & Destructor Documentation

◆ MemoryStream() [1/3]

duckdb::MemoryStream::MemoryStream ( Allocator allocator,
idx_t  capacity = DEFAULT_INITIAL_CAPACITY 
)
explicit

Create a new owning MemoryStream with an internal backing buffer with the specified capacity. The stream will own the backing buffer, resize it when needed and free its memory when the stream is destroyed

◆ MemoryStream() [2/3]

duckdb::MemoryStream::MemoryStream ( idx_t  capacity = DEFAULT_INITIAL_CAPACITY)
explicit

Create a new owning MemoryStream with an internal backing buffer with the specified capacity. The stream will own the backing buffer, resize it when needed and free its memory when the stream is destroyed

◆ MemoryStream() [3/3]

duckdb::MemoryStream::MemoryStream ( data_ptr_t  buffer,
idx_t  capacity 
)
explicit

Create a new non-owning MemoryStream over the specified external buffer and capacity. The stream will not take ownership of the backing buffer, will not attempt to resize it and will not free the memory when the stream is destroyed

Member Function Documentation

◆ WriteData()

void duckdb::MemoryStream::WriteData ( const_data_ptr_t  buffer,
idx_t  write_size 
)
overridevirtual

Write data to the stream. Throws if the write would exceed the capacity of the stream and the backing buffer is not owned by the stream

Implements duckdb::WriteStream.

◆ ReadData() [1/2]

void duckdb::MemoryStream::ReadData ( data_ptr_t  buffer,
idx_t  read_size 
)
overridevirtual

Read data from the stream. Throws if the read would exceed the capacity of the stream

Implements duckdb::ReadStream.

◆ ReadData() [2/2]

void duckdb::MemoryStream::ReadData ( QueryContext  context,
data_ptr_t  buffer,
idx_t  read_size 
)
overridevirtual

Implements duckdb::ReadStream.

◆ Release()

void duckdb::MemoryStream::Release ( )

Release ownership of the backing buffer and turn a owning stream into a non-owning one. The stream will no longer be responsible for freeing the data. The stream will also no longer attempt to automatically resize the buffer when the capacity is reached.


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