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::TryAddOperator Struct Reference

Public Member Functions

template<>
bool Operation (uint8_t left, uint8_t right, uint8_t &result)
template<>
bool Operation (uint16_t left, uint16_t right, uint16_t &result)
template<>
bool Operation (uint32_t left, uint32_t right, uint32_t &result)
template<>
bool Operation (uint64_t left, uint64_t right, uint64_t &result)
template<>
bool Operation (date_t left, int32_t right, date_t &result)
template<>
bool Operation (int8_t left, int8_t right, int8_t &result)
template<>
bool Operation (int16_t left, int16_t right, int16_t &result)
template<>
bool Operation (int32_t left, int32_t right, int32_t &result)
template<>
DUCKDB_API bool Operation (int64_t left, int64_t right, int64_t &result)
template<>
bool Operation (uhugeint_t left, uhugeint_t right, uhugeint_t &result)
template<>
bool Operation (hugeint_t left, hugeint_t right, hugeint_t &result)
template<>
bool Operation (uint8_t left, uint8_t right, uint8_t &result)
template<>
bool Operation (uint16_t left, uint16_t right, uint16_t &result)
template<>
bool Operation (uint32_t left, uint32_t right, uint32_t &result)
template<>
bool Operation (uint64_t left, uint64_t right, uint64_t &result)
template<>
bool Operation (date_t left, int32_t right, date_t &result)
template<>
bool Operation (int8_t left, int8_t right, int8_t &result)
template<>
bool Operation (int16_t left, int16_t right, int16_t &result)
template<>
bool Operation (int32_t left, int32_t right, int32_t &result)
template<>
bool Operation (int64_t left, int64_t right, int64_t &result)
template<>
bool Operation (uhugeint_t left, uhugeint_t right, uhugeint_t &result)
template<>
bool Operation (hugeint_t left, hugeint_t right, hugeint_t &result)

Static Public Member Functions

template<class TA, class TB, class TR>
static bool Operation (TA left, TB right, TR &result)

Member Function Documentation

◆ Operation() [1/12]

template<class TA, class TB, class TR>
bool duckdb::TryAddOperator::Operation ( TA left,
TB right,
TR & result )
inlinestatic
20155 {
20156 throw InternalException("Unimplemented type for TryAddOperator");
20157 }

◆ Operation() [2/12]

template<>
bool duckdb::TryAddOperator::Operation ( uint8_t left,
uint8_t right,
uint8_t & result )
227869 {
227870 return OverflowCheckedAddition::Operation<uint8_t, uint16_t>(left, right, result);
227871}

◆ Operation() [3/12]

template<>
bool duckdb::TryAddOperator::Operation ( uint16_t left,
uint16_t right,
uint16_t & result )
227873 {
227874 return OverflowCheckedAddition::Operation<uint16_t, uint32_t>(left, right, result);
227875}

◆ Operation() [4/12]

template<>
bool duckdb::TryAddOperator::Operation ( uint32_t left,
uint32_t right,
uint32_t & result )
227877 {
227878 return OverflowCheckedAddition::Operation<uint32_t, uint64_t>(left, right, result);
227879}

◆ Operation() [5/12]

template<>
bool duckdb::TryAddOperator::Operation ( uint64_t left,
uint64_t right,
uint64_t & result )
227882 {
227883 if (NumericLimits<uint64_t>::Maximum() - left < right) {
227884 return false;
227885 }
227886 return OverflowCheckedAddition::Operation<uint64_t, uint64_t>(left, right, result);
227887}

◆ Operation() [6/12]

template<>
bool duckdb::TryAddOperator::Operation ( date_t left,
int32_t right,
date_t & result )
227890 {
227891 if (left == date_t::infinity() || left == date_t::ninfinity()) {
227892 result = date_t(left);
227893 return true;
227894 }
227895 int32_t days;
227896 if (!TryAddOperator::Operation(left.days, right, days)) {
227897 return false;
227898 }
227899 result.days = days;
227900 if (!Value::IsFinite(result)) {
227901 return false;
227902 }
227903 return true;
227904}
::int32_t int32_t

◆ Operation() [7/12]

template<>
bool duckdb::TryAddOperator::Operation ( int8_t left,
int8_t right,
int8_t & result )
227907 {
227908 return OverflowCheckedAddition::Operation<int8_t, int16_t>(left, right, result);
227909}

◆ Operation() [8/12]

template<>
bool duckdb::TryAddOperator::Operation ( int16_t left,
int16_t right,
int16_t & result )
227912 {
227913 return OverflowCheckedAddition::Operation<int16_t, int32_t>(left, right, result);
227914}

◆ Operation() [9/12]

template<>
bool duckdb::TryAddOperator::Operation ( int32_t left,
int32_t right,
int32_t & result )
227917 {
227918 return OverflowCheckedAddition::Operation<int32_t, int64_t>(left, right, result);
227919}

◆ Operation() [10/12]

template<>
bool duckdb::TryAddOperator::Operation ( int64_t left,
int64_t right,
int64_t & result )
227922 {
227923#if (__GNUC__ >= 5) || defined(__clang__)
227924 if (__builtin_add_overflow(left, right, &result)) {
227925 return false;
227926 }
227927#else
227928 // https://blog.regehr.org/archives/1139
227929 result = int64_t((uint64_t)left + (uint64_t)right);
227930 if ((left < 0 && right < 0 && result >= 0) || (left >= 0 && right >= 0 && result < 0)) {
227931 return false;
227932 }
227933#endif
227934 return true;
227935}
::int64_t int64_t

◆ Operation() [11/12]

template<>
bool duckdb::TryAddOperator::Operation ( uhugeint_t left,
uhugeint_t right,
uhugeint_t & result )
227938 {
227939 if (!Uhugeint::TryAddInPlace(left, right)) {
227940 return false;
227941 }
227942 result = left;
227943 return true;
227944}

◆ Operation() [12/12]

template<>
bool duckdb::TryAddOperator::Operation ( hugeint_t left,
hugeint_t right,
hugeint_t & result )
227947 {
227948 if (!Hugeint::TryAddInPlace(left, right)) {
227949 return false;
227950 }
227951 result = left;
227952 return true;
227953}

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