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::PackedDataUtils< CHIMP_TYPE > Struct Template Reference

Static Public Member Functions

static void Unpack (uint16_t packed_data, UnpackedData &dest)
static uint16_t Pack (uint8_t index, uint8_t leading_zero, uint8_t significant_bits)

Static Private Attributes

static constexpr uint8_t INDEX_BITS_SIZE = 7
static constexpr uint8_t LEADING_BITS_SIZE = 3
static constexpr uint8_t INDEX_MASK = ((uint8_t)1 << INDEX_BITS_SIZE) - 1
static constexpr uint8_t LEADING_MASK = ((uint8_t)1 << LEADING_BITS_SIZE) - 1
static constexpr uint8_t INDEX_SHIFT_AMOUNT = (sizeof(uint16_t) * 8) - INDEX_BITS_SIZE
static constexpr uint8_t LEADING_SHIFT_AMOUNT = INDEX_SHIFT_AMOUNT - LEADING_BITS_SIZE

Member Function Documentation

◆ Unpack()

template<class CHIMP_TYPE>
void duckdb::PackedDataUtils< CHIMP_TYPE >::Unpack ( uint16_t packed_data,
UnpackedData & dest )
inlinestatic
392329 {
392330 dest.index = packed_data >> INDEX_SHIFT_AMOUNT & INDEX_MASK;
392331 dest.leading_zero = packed_data >> LEADING_SHIFT_AMOUNT & LEADING_MASK;
392333 // Verify that combined, this is not bigger than the full size of the type
392334 D_ASSERT(dest.significant_bits + dest.leading_zero <= (sizeof(CHIMP_TYPE) * 8));
392335 }
Definition duckdb.cpp:392313

◆ Pack()

template<class CHIMP_TYPE>
uint16_t duckdb::PackedDataUtils< CHIMP_TYPE >::Pack ( uint8_t index,
uint8_t leading_zero,
uint8_t significant_bits )
inlinestatic
392337 {
392338 static constexpr uint8_t BIT_SIZE = (sizeof(CHIMP_TYPE) * 8);
392339
392340 uint16_t result = 0;
392342 result += BIT_SIZE * (leading_zero & 7);
392343 if (BIT_SIZE == 32) {
392344 // Shift the result by 1 to occupy the 16th bit
392345 result <<= 1;
392346 }
392347 result += (significant_bits & 63);
392348
392349 return result;
392350 }

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