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::optional_ptr< T, SAFE > Class Template Reference

Public Member Functions

 optional_ptr (T *ptr_p)
 
 optional_ptr (T &ref)
 
 optional_ptr (const unique_ptr< T > &ptr_p)
 
 optional_ptr (const shared_ptr< T > &ptr_p)
 
void CheckValid () const
 
 operator bool () const
 
T & operator* ()
 
const T & operator* () const
 
T * operator-> ()
 
const T * operator-> () const
 
T * get ()
 
const T * get () const
 
T * get_mutable () const
 
bool operator== (const optional_ptr< T > &rhs) const
 
bool operator!= (const optional_ptr< T > &rhs) const
 

Private Attributes

T * ptr
 

Constructor & Destructor Documentation

◆ optional_ptr() [1/5]

template<class T , bool SAFE = true>
duckdb::optional_ptr< T, SAFE >::optional_ptr ( )
inlinenoexcept
2459 : ptr(nullptr) {
2460 }

◆ optional_ptr() [2/5]

template<class T , bool SAFE = true>
duckdb::optional_ptr< T, SAFE >::optional_ptr ( T *  ptr_p)
inline
2461 : ptr(ptr_p) { // NOLINT: allow implicit creation from pointer
2462 }

◆ optional_ptr() [3/5]

template<class T , bool SAFE = true>
duckdb::optional_ptr< T, SAFE >::optional_ptr ( T &  ref)
inline
2463 : ptr(&ref) { // NOLINT: allow implicit creation from reference
2464 }

◆ optional_ptr() [4/5]

template<class T , bool SAFE = true>
duckdb::optional_ptr< T, SAFE >::optional_ptr ( const unique_ptr< T > &  ptr_p)
inline
2465 : ptr(ptr_p.get()) { // NOLINT: allow implicit creation from unique pointer
2466 }

◆ optional_ptr() [5/5]

template<class T , bool SAFE = true>
duckdb::optional_ptr< T, SAFE >::optional_ptr ( const shared_ptr< T > &  ptr_p)
inline
2467 : ptr(ptr_p.get()) { // NOLINT: allow implicit creation from shared pointer
2468 }

Member Function Documentation

◆ CheckValid()

template<class T , bool SAFE = true>
void duckdb::optional_ptr< T, SAFE >::CheckValid ( ) const
inline
2470 {
2471 if (MemorySafety<SAFE>::ENABLED) {
2472 if (!ptr) {
2473 throw InternalException("Attempting to dereference an optional pointer that is not set");
2474 }
2475 }
2476 }

◆ operator bool()

template<class T , bool SAFE = true>
duckdb::optional_ptr< T, SAFE >::operator bool ( ) const
inline
2478 { // NOLINT: allow implicit conversion to bool
2479 return ptr;
2480 }

◆ operator*() [1/2]

template<class T , bool SAFE = true>
T & duckdb::optional_ptr< T, SAFE >::operator* ( )
inline
2481 {
2482 CheckValid();
2483 return *ptr;
2484 }

◆ operator*() [2/2]

template<class T , bool SAFE = true>
const T & duckdb::optional_ptr< T, SAFE >::operator* ( ) const
inline
2485 {
2486 CheckValid();
2487 return *ptr;
2488 }

◆ operator->() [1/2]

template<class T , bool SAFE = true>
T * duckdb::optional_ptr< T, SAFE >::operator-> ( )
inline
2489 {
2490 CheckValid();
2491 return ptr;
2492 }

◆ operator->() [2/2]

template<class T , bool SAFE = true>
const T * duckdb::optional_ptr< T, SAFE >::operator-> ( ) const
inline
2493 {
2494 CheckValid();
2495 return ptr;
2496 }

◆ get() [1/2]

template<class T , bool SAFE = true>
T * duckdb::optional_ptr< T, SAFE >::get ( )
inline
2497 { // NOLINT: mimic std casing
2498 // CheckValid();
2499 return ptr;
2500 }

◆ get() [2/2]

template<class T , bool SAFE = true>
const T * duckdb::optional_ptr< T, SAFE >::get ( ) const
inline
2501 { // NOLINT: mimic std casing
2502 // CheckValid();
2503 return ptr;
2504 }

◆ get_mutable()

template<class T , bool SAFE = true>
T * duckdb::optional_ptr< T, SAFE >::get_mutable ( ) const
inline
2506 { // NOLINT: mimic std casing
2507 // CheckValid();
2508 return ptr;
2509 }

◆ operator==()

template<class T , bool SAFE = true>
bool duckdb::optional_ptr< T, SAFE >::operator== ( const optional_ptr< T > &  rhs) const
inline
2511 {
2512 return ptr == rhs.ptr;
2513 }

◆ operator!=()

template<class T , bool SAFE = true>
bool duckdb::optional_ptr< T, SAFE >::operator!= ( const optional_ptr< T > &  rhs) const
inline
2515 {
2516 return ptr != rhs.ptr;
2517 }

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