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::optionally_owned_ptr< T > Class Template Reference
Collaboration diagram for duckdb::optionally_owned_ptr< T >:

Public Member Functions

 optionally_owned_ptr (T *ptr_p)
 
 optionally_owned_ptr (T &ref)
 
 optionally_owned_ptr (unique_ptr< T > &&owned_p)
 
 optionally_owned_ptr (shared_ptr< T > owned_p)
 
 optionally_owned_ptr (optionally_owned_ptr &&other) noexcept
 
 optionally_owned_ptr (const optionally_owned_ptr &other)=delete
 
 operator bool () const
 
T & operator* ()
 
const T & operator* () const
 
T * operator-> ()
 
const T * operator-> () const
 
T * get ()
 
const T * get () const
 
bool is_owned () const
 
const unique_ptr< T > & get_owned_unique () const
 
const shared_ptr< T > & get_owned_shared () const
 
T * get_mutable () const
 
optionally_owned_ptr< T > & operator= (T &ref)
 
optionally_owned_ptr< T > & operator= (T *ref)
 
bool operator== (const optionally_owned_ptr< T > &rhs) const
 
bool operator!= (const optionally_owned_ptr< T > &rhs) const
 

Private Attributes

unique_ptr< T > owned
 
shared_ptr< T > owned_shared
 
optional_ptr< T > ptr
 

Constructor & Destructor Documentation

◆ optionally_owned_ptr() [1/6]

template<class T >
duckdb::optionally_owned_ptr< T >::optionally_owned_ptr ( )
inline
44538 {
44539 }

◆ optionally_owned_ptr() [2/6]

template<class T >
duckdb::optionally_owned_ptr< T >::optionally_owned_ptr ( T *  ptr_p)
inline
44540 : ptr(ptr_p) { // NOLINT: allow implicit creation from pointer
44541 }

◆ optionally_owned_ptr() [3/6]

template<class T >
duckdb::optionally_owned_ptr< T >::optionally_owned_ptr ( T &  ref)
inline
44542 : ptr(&ref) { // NOLINT: allow implicit creation from reference
44543 }

◆ optionally_owned_ptr() [4/6]

template<class T >
duckdb::optionally_owned_ptr< T >::optionally_owned_ptr ( unique_ptr< T > &&  owned_p)
inline
44545 : owned(std::move(owned_p)), ptr(owned) {
44546 }

◆ optionally_owned_ptr() [5/6]

template<class T >
duckdb::optionally_owned_ptr< T >::optionally_owned_ptr ( shared_ptr< T >  owned_p)
inline
44548 : owned_shared(std::move(owned_p)), ptr(*owned_shared) {
44549 }

◆ optionally_owned_ptr() [6/6]

template<class T >
duckdb::optionally_owned_ptr< T >::optionally_owned_ptr ( optionally_owned_ptr< T > &&  other)
inlinenoexcept
44552 : owned(std::move(other.owned)), owned_shared(std::move(other.owned_shared)), ptr(other.ptr) {
44553 other.ptr = nullptr;
44554 }

Member Function Documentation

◆ operator bool()

template<class T >
duckdb::optionally_owned_ptr< T >::operator bool ( ) const
inline
44558 { // NOLINT: allow implicit conversion to bool
44559 return ptr;
44560 }

◆ operator*() [1/2]

template<class T >
T & duckdb::optionally_owned_ptr< T >::operator* ( )
inline
44561 {
44562 return *ptr;
44563 }

◆ operator*() [2/2]

template<class T >
const T & duckdb::optionally_owned_ptr< T >::operator* ( ) const
inline
44564 {
44565 return *ptr;
44566 }

◆ operator->() [1/2]

template<class T >
T * duckdb::optionally_owned_ptr< T >::operator-> ( )
inline
44567 {
44568 return ptr.get();
44569 }

◆ operator->() [2/2]

template<class T >
const T * duckdb::optionally_owned_ptr< T >::operator-> ( ) const
inline
44570 {
44571 return ptr.get();
44572 }

◆ get() [1/2]

template<class T >
T * duckdb::optionally_owned_ptr< T >::get ( )
inline
44573 { // NOLINT: mimic std casing
44574 return ptr.get();
44575 }

◆ get() [2/2]

template<class T >
const T * duckdb::optionally_owned_ptr< T >::get ( ) const
inline
44576 { // NOLINT: mimic std casing
44577 return ptr.get();
44578 }

◆ is_owned()

template<class T >
bool duckdb::optionally_owned_ptr< T >::is_owned ( ) const
inline
44579 { // NOLINT: mimic std casing
44580 return owned != nullptr || owned_shared != nullptr;
44581 }

◆ get_owned_unique()

template<class T >
const unique_ptr< T > & duckdb::optionally_owned_ptr< T >::get_owned_unique ( ) const
inline
44582 {
44583 return owned;
44584 }

◆ get_owned_shared()

template<class T >
const shared_ptr< T > & duckdb::optionally_owned_ptr< T >::get_owned_shared ( ) const
inline
44585 {
44586 return owned_shared;
44587 }

◆ get_mutable()

template<class T >
T * duckdb::optionally_owned_ptr< T >::get_mutable ( ) const
inline
44589 { // NOLINT: mimic std casing
44590 return ptr.get();
44591 }

◆ operator=() [1/2]

template<class T >
optionally_owned_ptr< T > & duckdb::optionally_owned_ptr< T >::operator= ( T &  ref)
inline
44593 {
44594 owned = nullptr;
44595 owned_shared = nullptr;
44596 ptr = optional_ptr<T>(ref);
44597 return *this;
44598 }

◆ operator=() [2/2]

template<class T >
optionally_owned_ptr< T > & duckdb::optionally_owned_ptr< T >::operator= ( T *  ref)
inline
44599 {
44600 owned = nullptr;
44601 owned_shared = nullptr;
44602 ptr = optional_ptr<T>(ref);
44603 return *this;
44604 }

◆ operator==()

template<class T >
bool duckdb::optionally_owned_ptr< T >::operator== ( const optionally_owned_ptr< T > &  rhs) const
inline
44606 {
44607 if (owned != rhs.owned) {
44608 return false;
44609 }
44610 if (owned_shared != rhs.owned_shared) {
44611 return false;
44612 }
44613 return ptr == rhs.ptr;
44614 }

◆ operator!=()

template<class T >
bool duckdb::optionally_owned_ptr< T >::operator!= ( const optionally_owned_ptr< T > &  rhs) const
inline
44616 {
44617 return !(*this == rhs);
44618 }

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