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::BufferedData Class Referenceabstract
Inheritance diagram for duckdb::BufferedData:
Collaboration diagram for duckdb::BufferedData:

Public Member Functions

 BufferedData (Type type, ClientContext &context)
StreamExecutionResult ReplenishBuffer (StreamQueryResult &result, ClientContextLock &context_lock)
virtual StreamExecutionResult ExecuteTaskInternal (StreamQueryResult &result, ClientContextLock &context_lock)=0
virtual unique_ptr< DataChunk > Scan ()=0
virtual void UnblockSinks ()=0
shared_ptr< ClientContext > GetContext ()
bool Closed () const
void Close ()
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Protected Types

enum class  Type { SIMPLE , BATCHED }

Protected Attributes

Type type
weak_ptr< ClientContext > context
 This is weak to avoid a cyclical reference.
idx_t total_buffer_size
 The maximum amount of memory we should keep buffered.
mutex glock
 Protect against populate/fetch race condition.

Member Enumeration Documentation

◆ Type

enum class duckdb::BufferedData::Type
strongprotected
41176{ SIMPLE, BATCHED };

Constructor & Destructor Documentation

◆ BufferedData()

duckdb::BufferedData::BufferedData ( Type type,
ClientContext & context )
262630 : type(type), context(context_p.shared_from_this()) {
262631 auto &config = ClientConfig::GetConfig(context_p);
262632 total_buffer_size = config.streaming_buffer_size;
262633}
idx_t total_buffer_size
The maximum amount of memory we should keep buffered.
Definition duckdb.hpp:41223
weak_ptr< ClientContext > context
This is weak to avoid a cyclical reference.
Definition duckdb.hpp:41221

◆ ~BufferedData()

duckdb::BufferedData::~BufferedData ( )
virtual
262635 {
262636}

Member Function Documentation

◆ ReplenishBuffer()

StreamExecutionResult duckdb::BufferedData::ReplenishBuffer ( StreamQueryResult & result,
ClientContextLock & context_lock )
262638 {
262639 auto cc = context.lock();
262640 if (!cc) {
262641 return StreamExecutionResult::EXECUTION_CANCELLED;
262642 }
262643
262644 StreamExecutionResult execution_result;
262645 while (!StreamQueryResult::IsChunkReady(execution_result = ExecuteTaskInternal(result, context_lock))) {
262646 if (execution_result == StreamExecutionResult::BLOCKED) {
262647 UnblockSinks();
262648 cc->WaitForTask(context_lock, result);
262649 }
262650 }
262651 if (result.HasError()) {
262652 Close();
262653 }
262654 return execution_result;
262655}

◆ GetContext()

shared_ptr< ClientContext > duckdb::BufferedData::GetContext ( )
inline
41187 {
41188 return context.lock();
41189 }

◆ Closed()

bool duckdb::BufferedData::Closed ( ) const
inline
41190 {
41191 if (context.expired()) {
41192 return true;
41193 }
41194 auto c = context.lock();
41195 return c == nullptr;
41196 }

◆ Close()

void duckdb::BufferedData::Close ( )
inline
41197 {
41198 context.reset();
41199 }

◆ Cast() [1/2]

template<class TARGET>
TARGET & duckdb::BufferedData::Cast ( )
inline
41203 {
41204 if (TARGET::TYPE != type) {
41205 throw InternalException("Failed to cast buffered data to type - buffered data type mismatch");
41206 }
41207 return reinterpret_cast<TARGET &>(*this);
41208 }

◆ Cast() [2/2]

template<class TARGET>
const TARGET & duckdb::BufferedData::Cast ( ) const
inline
41211 {
41212 if (TARGET::TYPE != type) {
41213 throw InternalException("Failed to cast buffered data to type - buffered data type mismatch");
41214 }
41215 return reinterpret_cast<const TARGET &>(*this);
41216 }

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