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::ArenaLinkedList< T > Class Template Reference
Collaboration diagram for duckdb::ArenaLinkedList< T >:

Classes

struct  ConstIterator
 
struct  Iterator
 
struct  Node
 

Public Member Functions

 ArenaLinkedList (ArenaAllocator &arena)
 
 ArenaLinkedList (const ArenaLinkedList &)=delete
 
ArenaLinkedListoperator= (const ArenaLinkedList &)=delete
 
 ArenaLinkedList (ArenaLinkedList &&other) noexcept
 
ArenaLinkedListoperator= (ArenaLinkedList &&other) noexcept
 
bool empty () const
 
idx_t size () const
 
void push_back (const T &value)
 
template<class... ARGS>
void emplace_back (ARGS &&... args)
 
T & operator[] (const idx_t index)
 FIXME: eventually remove this.
 
const T & operator[] (const idx_t index) const
 FIXME: eventually remove this.
 
Iterator begin ()
 
Iterator end ()
 
ConstIterator begin () const
 
ConstIterator end () const
 

Private Attributes

ArenaAllocatorarena
 
Nodehead = nullptr
 
Nodetail = nullptr
 
idx_t _size = 0
 

Constructor & Destructor Documentation

◆ ArenaLinkedList() [1/2]

template<class T >
duckdb::ArenaLinkedList< T >::ArenaLinkedList ( ArenaAllocator arena)
inlineexplicit
19983 : arena(arena) {
19984 }

◆ ArenaLinkedList() [2/2]

template<class T >
duckdb::ArenaLinkedList< T >::ArenaLinkedList ( ArenaLinkedList< T > &&  other)
inlinenoexcept
19989 : head(other.head), tail(other.tail) {
19990 other.head = nullptr;
19991 other.tail = nullptr;
19992 }

Member Function Documentation

◆ operator=()

template<class T >
ArenaLinkedList & duckdb::ArenaLinkedList< T >::operator= ( ArenaLinkedList< T > &&  other)
inlinenoexcept
19993 {
19994 if (this != &other) {
19995 head = other.head;
19996 tail = other.tail;
19997 other.head = nullptr;
19998 other.tail = nullptr;
19999 }
20000 return *this;
20001 }

◆ empty()

template<class T >
bool duckdb::ArenaLinkedList< T >::empty ( ) const
inline
20004 {
20005 return head == nullptr;
20006 }

◆ size()

template<class T >
idx_t duckdb::ArenaLinkedList< T >::size ( ) const
inline
20008 {
20009 return _size;
20010 }

◆ push_back()

template<class T >
void duckdb::ArenaLinkedList< T >::push_back ( const T &  value)
inline
20012 {
20013 auto node = arena.Make<Node>(value);
20014 auto ptr = head ? &tail->next : &head;
20015 *ptr = node;
20016 tail = node;
20017 _size++;
20018 }

◆ emplace_back()

template<class T >
template<class... ARGS>
void duckdb::ArenaLinkedList< T >::emplace_back ( ARGS &&...  args)
inline
20021 {
20022 auto node = arena.Make<Node>(std::forward<ARGS>(args)...);
20023 auto ptr = head ? &tail->next : &head;
20024 *ptr = node;
20025 tail = node;
20026 _size++;
20027 }

◆ operator[]() [1/2]

template<class T >
T & duckdb::ArenaLinkedList< T >::operator[] ( const idx_t  index)
inline

FIXME: eventually remove this.

20030 {
20031 idx_t i = 0;
20032 for (auto &elem : *this) {
20033 if (i == index) {
20034 return elem;
20035 }
20036 i++;
20037 }
20038 throw InternalException("index out of bounds in ArenaLinkedList");
20039 }

◆ operator[]() [2/2]

template<class T >
const T & duckdb::ArenaLinkedList< T >::operator[] ( const idx_t  index) const
inline

FIXME: eventually remove this.

20042 {
20043 idx_t i = 0;
20044 for (const auto &elem : *this) {
20045 if (i == index) {
20046 return elem;
20047 }
20048 i++;
20049 }
20050 throw InternalException("index out of bounds in ArenaLinkedList");
20051 }

◆ begin() [1/2]

template<class T >
ArenaLinkedList< T >::Iterator duckdb::ArenaLinkedList< T >::begin ( )
20118 {
20119 return Iterator(head);
20120}

◆ end() [1/2]

template<class T >
ArenaLinkedList< T >::Iterator duckdb::ArenaLinkedList< T >::end ( )
20123 {
20124 return Iterator(nullptr);
20125}

◆ begin() [2/2]

template<class T >
ArenaLinkedList< T >::ConstIterator duckdb::ArenaLinkedList< T >::begin ( ) const
20128 {
20129 return ConstIterator(head);
20130}

◆ end() [2/2]

template<class T >
ArenaLinkedList< T >::ConstIterator duckdb::ArenaLinkedList< T >::end ( ) const
20133 {
20134 return ConstIterator(nullptr);
20135}

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