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::FlagBuffer< EMPTY > Class Template Reference

Public Member Functions

void SetBuffer (uint8_t *buffer)
void Reset ()
uint64_t BitsWritten () const
void Insert (ChimpConstants::Flags value)
uint8_t Extract ()
uint32_t BytesUsed () const
uint32_t FlagCount () const

Private Attributes

uint32_t counter = 0
uint8_t * buffer

Constructor & Destructor Documentation

◆ FlagBuffer()

template<bool EMPTY>
duckdb::FlagBuffer< EMPTY >::FlagBuffer ( )
inline
396695 : counter(0), buffer(nullptr) {
396696 }

Member Function Documentation

◆ SetBuffer()

template<bool EMPTY>
void duckdb::FlagBuffer< EMPTY >::SetBuffer ( uint8_t * buffer)
inline
396699 {
396700 this->buffer = buffer;
396701 this->counter = 0;
396702 }

◆ Reset()

template<bool EMPTY>
void duckdb::FlagBuffer< EMPTY >::Reset ( )
inline
396703 {
396704 this->counter = 0;
396705#ifdef DEBUG
396706 this->flags.clear();
396707#endif
396708 }
Definition duckdb.cpp:396693

◆ BitsWritten()

template<bool EMPTY>
uint64_t duckdb::FlagBuffer< EMPTY >::BitsWritten ( ) const
inline
396716 {
396717 return counter * 2ULL;
396718 }

◆ Insert()

template<bool EMPTY>
void duckdb::FlagBuffer< EMPTY >::Insert ( ChimpConstants::Flags value)
inline
396720 {
396721 if (!EMPTY) {
396722 if ((counter & 3) == 0) {
396723 // Start the new byte fresh
396724 buffer[counter >> 2] = 0;
396725#ifdef DEBUG
396726 flags.clear();
396727#endif
396728 }
396729#ifdef DEBUG
396730 flags.push_back((uint8_t)value);
396731#endif
396732 buffer[counter >> 2] |= (((uint8_t)value & 3) << FlagBufferConstants::SHIFTS[counter & 3]);
396733#ifdef DEBUG
396734 // Verify that the bits are serialized correctly
396735 D_ASSERT(flags[counter & 3] == ExtractValue(buffer[counter >> 2], counter & 3));
396736#endif
396737 }
396738 counter++;
396739 }

◆ Extract()

template<bool EMPTY>
uint8_t duckdb::FlagBuffer< EMPTY >::Extract ( )
inline
396740 {
396741 const uint8_t result = (buffer[counter >> 2] & FlagBufferConstants::MASKS[counter & 3]) >>
396742 FlagBufferConstants::SHIFTS[counter & 3];
396743 counter++;
396744 return result;
396745 }

◆ BytesUsed()

template<bool EMPTY>
uint32_t duckdb::FlagBuffer< EMPTY >::BytesUsed ( ) const
inline
396747 {
396748 return (counter >> 2) + ((counter & 3) != 0);
396749 }

◆ FlagCount()

template<bool EMPTY>
uint32_t duckdb::FlagBuffer< EMPTY >::FlagCount ( ) const
inline
396751 {
396752 return counter;
396753 }

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