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::RingBuffer< CHIMP_TYPE > Class Template Reference

Public Member Functions

void Reset ()
template<bool FIRST = false>
void Insert (uint64_t value)
template<bool FIRST = false>
void InsertScan (uint64_t value)
const uint64_t & Top () const
const uint64_t & IndexOf (const uint64_t &key) const
 Get the index where values that produce this 'key' are stored.
const uint64_t & Value (const uint8_t &index_p) const
 Get the value at position 'index' of the buffer.
const uint64_t & Size () const
 Get the amount of values that are inserted.
uint64_t Key (const uint64_t &value) const

Static Public Attributes

static constexpr uint8_t RING_SIZE = ChimpConstants::BUFFER_SIZE
static constexpr uint64_t LEAST_SIGNIFICANT_BIT_COUNT = SignificantBits<CHIMP_TYPE>::size + 7 + 1
static constexpr uint64_t LEAST_SIGNIFICANT_BIT_MASK = (1 << LEAST_SIGNIFICANT_BIT_COUNT) - 1
static constexpr uint16_t INDICES_SIZE = 1 << LEAST_SIGNIFICANT_BIT_COUNT

Private Attributes

uint64_t buffer [RING_SIZE] = {}
uint64_t index = 0
 Stores the corresponding values.
uint64_t indices [INDICES_SIZE] = {}
 Keeps track of the index of the current value.

Constructor & Destructor Documentation

◆ RingBuffer()

template<class CHIMP_TYPE>
duckdb::RingBuffer< CHIMP_TYPE >::RingBuffer ( )
inline
392117 : index(0) {
392118 }
uint64_t index
Stores the corresponding values.
Definition duckdb.cpp:392155

Member Function Documentation

◆ Reset()

template<class CHIMP_TYPE>
void duckdb::RingBuffer< CHIMP_TYPE >::Reset ( )
inline
392113 {
392114 index = 0;
392115 }

◆ Insert()

template<class CHIMP_TYPE>
template<bool FIRST = false>
void duckdb::RingBuffer< CHIMP_TYPE >::Insert ( uint64_t value)
inline
392120 {
392121 if (!FIRST) {
392122 index++;
392123 }
392124 buffer[index % RING_SIZE] = value;
392125 indices[Key(value)] = index;
392126 }
Definition duckdb.cpp:392105
uint64_t indices[INDICES_SIZE]
Keeps track of the index of the current value.
Definition duckdb.cpp:392156

◆ InsertScan()

template<class CHIMP_TYPE>
template<bool FIRST = false>
void duckdb::RingBuffer< CHIMP_TYPE >::InsertScan ( uint64_t value)
inline
392128 {
392129 if (!FIRST) {
392130 index++;
392131 }
392132 buffer[index % RING_SIZE] = value;
392133 }

◆ Top()

template<class CHIMP_TYPE>
const uint64_t & duckdb::RingBuffer< CHIMP_TYPE >::Top ( ) const
inline
392134 {
392135 return buffer[index % RING_SIZE];
392136 }

◆ IndexOf()

template<class CHIMP_TYPE>
const uint64_t & duckdb::RingBuffer< CHIMP_TYPE >::IndexOf ( const uint64_t & key) const
inline

Get the index where values that produce this 'key' are stored.

392138 {
392139 return indices[key];
392140 }

◆ Value()

template<class CHIMP_TYPE>
const uint64_t & duckdb::RingBuffer< CHIMP_TYPE >::Value ( const uint8_t & index_p) const
inline

Get the value at position 'index' of the buffer.

392142 {
392143 return buffer[index_p];
392144 }

◆ Size()

template<class CHIMP_TYPE>
const uint64_t & duckdb::RingBuffer< CHIMP_TYPE >::Size ( ) const
inline

Get the amount of values that are inserted.

392146 {
392147 return index;
392148 }

◆ Key()

template<class CHIMP_TYPE>
uint64_t duckdb::RingBuffer< CHIMP_TYPE >::Key ( const uint64_t & value) const
inline
392149 {
392150 return value & LEAST_SIGNIFICANT_BIT_MASK;
392151 }

Member Data Documentation

◆ buffer

template<class CHIMP_TYPE>
uint64_t duckdb::RingBuffer< CHIMP_TYPE >::buffer[RING_SIZE] = {}
private
392154{};

◆ indices

template<class CHIMP_TYPE>
uint64_t duckdb::RingBuffer< CHIMP_TYPE >::indices[INDICES_SIZE] = {}
private

Keeps track of the index of the current value.

392156{};

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