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::FixedSortKey< SORT_KEY, HAS_PAYLOAD > Struct Template Reference
Inheritance diagram for duckdb::FixedSortKey< SORT_KEY, HAS_PAYLOAD >:
Collaboration diagram for duckdb::FixedSortKey< SORT_KEY, HAS_PAYLOAD >:

Public Member Functions

void ByteSwap ()
 
void Construct (const string_t &str, data_ptr_t &)
 
void Construct (const int64_t &val, data_ptr_t &)
 
void Deconstruct (string_t &val)
 
void Deconstruct (int64_t &val)
 
data_ptr_t GetData () const
 
idx_t GetSize () const
 
idx_t GetHeapSize () const
 

Static Public Attributes

static constexpr bool CONSTANT_SIZE = true
 

Protected Attributes

friend SORT_KEY
 

Friends

bool operator< (const SORT_KEY &lhs, const SORT_KEY &rhs)
 

Member Function Documentation

◆ ByteSwap()

template<class SORT_KEY , bool HAS_PAYLOAD>
void duckdb::FixedSortKey< SORT_KEY, HAS_PAYLOAD >::ByteSwap ( )
inline
55418 {
55419 auto &sort_key = static_cast<SORT_KEY &>(*this);
55420 for (idx_t i = 0; i < SORT_KEY::PARTS; i++) {
55421 (&sort_key.part0)[i] = BSwapIfLE((&sort_key.part0)[i]);
55422 }
55423 }

◆ Construct() [1/2]

template<class SORT_KEY , bool HAS_PAYLOAD>
void duckdb::FixedSortKey< SORT_KEY, HAS_PAYLOAD >::Construct ( const string_t str,
data_ptr_t &   
)
inline
55425 {
55426 D_ASSERT(str.GetSize() <= SORT_KEY::INLINE_LENGTH);
55427 auto &sort_key = static_cast<SORT_KEY &>(*this);
55428 for (idx_t i = 0; i < SORT_KEY::PARTS; i++) {
55429 (&sort_key.part0)[i] = 0;
55430 }
55431
55432 if (SORT_KEY::INLINE_LENGTH <= string_t::INLINE_LENGTH) {
55433 memcpy(&sort_key.part0, str.GetPrefix(), SORT_KEY::INLINE_LENGTH);
55434 } else if (str.IsInlined()) {
55435 memcpy(&sort_key.part0, str.GetPrefix(), string_t::INLINE_LENGTH);
55436 } else {
55437 FastMemcpy(&sort_key.part0, str.GetPointer(), str.GetSize());
55438 }
55439
55440 // IMPORTANT NOTE: We don't actually store the data in byte-comparable order!
55441 // This allows us to do int64_t comparisons, yielding better performance.
55442 // This means we have to ByteSwap once more when decoding the keys later.
55443 ByteSwap();
55444 }
void FastMemcpy(void *dest, const void *src, const size_t size)
Definition duckdb.cpp:35899

◆ Construct() [2/2]

template<class SORT_KEY , bool HAS_PAYLOAD>
void duckdb::FixedSortKey< SORT_KEY, HAS_PAYLOAD >::Construct ( const int64_t val,
data_ptr_t &   
)
inline
55446 {
55447 auto &sort_key = static_cast<SORT_KEY &>(*this);
55448 sort_key.part0 = static_cast<uint64_t>(val); // NOLINT: unsafe cast on purpose
55449 }
::uint64_t uint64_t

◆ Deconstruct() [1/2]

template<class SORT_KEY , bool HAS_PAYLOAD>
void duckdb::FixedSortKey< SORT_KEY, HAS_PAYLOAD >::Deconstruct ( string_t val)
inline
55451 {
55452 auto &sort_key = static_cast<SORT_KEY &>(*this);
55453 ByteSwap();
55454 val = string_t(const_char_ptr_cast(&sort_key.part0), UnsafeNumericCast<uint32_t>(SORT_KEY::INLINE_LENGTH));
55455 }

◆ Deconstruct() [2/2]

template<class SORT_KEY , bool HAS_PAYLOAD>
void duckdb::FixedSortKey< SORT_KEY, HAS_PAYLOAD >::Deconstruct ( int64_t val)
inline
55457 {
55458 auto &sort_key = static_cast<SORT_KEY &>(*this);
55459 val = static_cast<int64_t>(sort_key.part0); // NOLINT: unsafe cast on purpose
55460 }
::int64_t int64_t

◆ GetData()

template<class SORT_KEY , bool HAS_PAYLOAD>
data_ptr_t duckdb::FixedSortKey< SORT_KEY, HAS_PAYLOAD >::GetData ( ) const
inline
55462 {
55463 throw InternalException("GetData() called on a FixedSortKey");
55464 }

◆ GetSize()

template<class SORT_KEY , bool HAS_PAYLOAD>
idx_t duckdb::FixedSortKey< SORT_KEY, HAS_PAYLOAD >::GetSize ( ) const
inline
55466 {
55467 throw InternalException("GetSize() called on a FixedSortKey");
55468 }

◆ GetHeapSize()

template<class SORT_KEY , bool HAS_PAYLOAD>
idx_t duckdb::FixedSortKey< SORT_KEY, HAS_PAYLOAD >::GetHeapSize ( ) const
inline
55470 {
55471 throw InternalException("GetHeapSize() called on a FixedSortKey");
55472 }

Friends And Related Symbol Documentation

◆ operator<

template<class SORT_KEY , bool HAS_PAYLOAD>
bool operator< ( const SORT_KEY &  lhs,
const SORT_KEY &  rhs 
)
friend
55474 {
55475 return SortKeyLessThan<SORT_KEY::PARTS>(&lhs.part0, &rhs.part0);
55476 }

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