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::InterruptState Class Reference

State required to make the callback after some asynchronous operation within an operator source / sink. More...

#include <duckdb.hpp>

Collaboration diagram for duckdb::InterruptState:

Public Member Functions

 InterruptState ()
 Default interrupt state will be set to InterruptMode::NO_INTERRUPTS and throw an error on use of Callback().
 InterruptState (weak_ptr< Task > task)
 Register the task to be interrupted and set mode to InterruptMode::TASK, the preferred way to handle interrupts.
 InterruptState (weak_ptr< InterruptDoneSignalState > done_signal)
 Register signal state and set mode to InterruptMode::BLOCKING, used for code paths without Task.
DUCKDB_API void Callback () const
 Perform the callback to indicate the Interrupt is over.

Protected Attributes

InterruptMode mode
 Current interrupt mode.
weak_ptr< Task > current_task
 Task ptr for InterruptMode::TASK.
weak_ptr< InterruptDoneSignalState > signal_state
 Signal state for InterruptMode::BLOCKING.

Detailed Description

State required to make the callback after some asynchronous operation within an operator source / sink.

Constructor & Destructor Documentation

◆ InterruptState() [1/3]

duckdb::InterruptState::InterruptState ( )

Default interrupt state will be set to InterruptMode::NO_INTERRUPTS and throw an error on use of Callback().

329232 : mode(InterruptMode::NO_INTERRUPTS) {
329233}
InterruptMode mode
Current interrupt mode.
Definition duckdb.hpp:21872

◆ InterruptState() [2/3]

duckdb::InterruptState::InterruptState ( weak_ptr< Task > task)
explicit

Register the task to be interrupted and set mode to InterruptMode::TASK, the preferred way to handle interrupts.

329234 : mode(InterruptMode::TASK), current_task(std::move(task)) {
329235}
weak_ptr< Task > current_task
Task ptr for InterruptMode::TASK.
Definition duckdb.hpp:21874

◆ InterruptState() [3/3]

duckdb::InterruptState::InterruptState ( weak_ptr< InterruptDoneSignalState > done_signal)
explicit

Register signal state and set mode to InterruptMode::BLOCKING, used for code paths without Task.

329237 : mode(InterruptMode::BLOCKING), signal_state(std::move(signal_state_p)) {
329238}
weak_ptr< InterruptDoneSignalState > signal_state
Signal state for InterruptMode::BLOCKING.
Definition duckdb.hpp:21876

Member Function Documentation

◆ Callback()

void duckdb::InterruptState::Callback ( ) const

Perform the callback to indicate the Interrupt is over.

329240 {
329241 if (mode == InterruptMode::TASK) {
329242 auto task = current_task.lock();
329243
329244 if (!task) {
329245 return;
329246 }
329247
329248 task->Reschedule();
329249 } else if (mode == InterruptMode::BLOCKING) {
329250 auto signal_state_l = signal_state.lock();
329251
329252 if (!signal_state_l) {
329253 return;
329254 }
329255
329256 // Signal the caller, who is currently blocked
329257 signal_state_l->Signal();
329258 } else {
329259 throw InternalException("Callback made on InterruptState without valid interrupt mode specified");
329260 }
329261}

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