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::IntegerCastOperation Struct Reference
Inheritance diagram for duckdb::IntegerCastOperation:

Static Public Member Functions

template<class T , bool NEGATIVE>
static bool HandleDigit (T &state, uint8_t digit)
 
template<class T , bool NEGATIVE>
static bool HandleHexDigit (T &state, uint8_t digit)
 
template<class T , bool NEGATIVE>
static bool HandleBinaryDigit (T &state, uint8_t digit)
 
template<class T , bool NEGATIVE>
static bool HandleExponent (T &state, int16_t exponent)
 
template<class T , bool NEGATIVE, bool ALLOW_EXPONENT>
static bool HandleDecimal (T &state, uint8_t digit)
 
template<class T , bool NEGATIVE>
static bool Finalize (T &state)
 

Member Function Documentation

◆ HandleDigit()

template<class T , bool NEGATIVE>
static bool duckdb::IntegerCastOperation::HandleDigit ( T &  state,
uint8_t  digit 
)
inlinestatic
54174 {
54175 using store_t = typename T::StoreType;
54176 if (NEGATIVE) {
54177 if (DUCKDB_UNLIKELY(state.result < (NumericLimits<store_t>::Minimum() + digit) / 10)) {
54178 return false;
54179 }
54180 state.result = UnsafeNumericCast<store_t>(state.result * 10 - digit);
54181 } else {
54182 if (DUCKDB_UNLIKELY(state.result > (NumericLimits<store_t>::Maximum() - digit) / 10)) {
54183 return false;
54184 }
54185 state.result = UnsafeNumericCast<store_t>(state.result * 10 + digit);
54186 }
54187 return true;
54188 }

◆ HandleHexDigit()

template<class T , bool NEGATIVE>
static bool duckdb::IntegerCastOperation::HandleHexDigit ( T &  state,
uint8_t  digit 
)
inlinestatic
54191 {
54192 using store_t = typename T::StoreType;
54193 if (DUCKDB_UNLIKELY(state.result > (NumericLimits<store_t>::Maximum() - digit) / 16)) {
54194 return false;
54195 }
54196 state.result = UnsafeNumericCast<store_t>(state.result * 16 + digit);
54197 return true;
54198 }

◆ HandleBinaryDigit()

template<class T , bool NEGATIVE>
static bool duckdb::IntegerCastOperation::HandleBinaryDigit ( T &  state,
uint8_t  digit 
)
inlinestatic
54201 {
54202 using store_t = typename T::StoreType;
54203 if (DUCKDB_UNLIKELY(state.result > (NumericLimits<store_t>::Maximum() - digit) / 2)) {
54204 return false;
54205 }
54206 state.result = UnsafeNumericCast<store_t>(state.result * 2 + digit);
54207 return true;
54208 }

◆ HandleExponent()

template<class T , bool NEGATIVE>
static bool duckdb::IntegerCastOperation::HandleExponent ( T &  state,
int16_t  exponent 
)
inlinestatic
54211 {
54212 // Simple integers don't deal with Exponents
54213 return false;
54214 }

◆ HandleDecimal()

template<class T , bool NEGATIVE, bool ALLOW_EXPONENT>
static bool duckdb::IntegerCastOperation::HandleDecimal ( T &  state,
uint8_t  digit 
)
inlinestatic
54217 {
54218 // Simple integers don't deal with Decimals
54219 return false;
54220 }

◆ Finalize()

template<class T , bool NEGATIVE>
static bool duckdb::IntegerCastOperation::Finalize ( T &  state)
inlinestatic
54223 {
54224 return true;
54225 }

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