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
internal::buffer< T > Class Template Referenceabstract
Inheritance diagram for internal::buffer< T >:

Public Types

using value_type = T
using const_reference = const T&

Public Member Functions

 buffer (const buffer &)=delete
void operator= (const buffer &)=delete
T * begin () FMT_NOEXCEPT
T * end () FMT_NOEXCEPT
std::size_t size () const FMT_NOEXCEPT
std::size_t capacity () const FMT_NOEXCEPT
T * data () FMT_NOEXCEPT
const T * data () const FMT_NOEXCEPT
void resize (std::size_t new_size)
void clear ()
void reserve (std::size_t new_capacity)
void push_back (const T &value)
template<typename U>
void append (const U *begin, const U *end)
T & operator[] (std::size_t index)
const T & operator[] (std::size_t index) const

Protected Member Functions

 buffer (std::size_t sz) FMT_NOEXCEPT
 buffer (T *p=nullptr, std::size_t sz=0, std::size_t cap=0) FMT_NOEXCEPT
void set (T *buf_data, std::size_t buf_capacity) FMT_NOEXCEPT
virtual void grow (std::size_t capacity)=0

Private Attributes

T * ptr_
std::size_t size_
std::size_t capacity_

Detailed Description

template<typename T>
class internal::buffer< T >

A contiguous memory buffer with an optional growing ability.

Constructor & Destructor Documentation

◆ buffer() [1/2]

template<typename T>
internal::buffer< T >::buffer ( std::size_t sz)
inlineprotected
15405: size_(sz), capacity_(sz) {}
Definition duckdb.cpp:15397

◆ buffer() [2/2]

template<typename T>
internal::buffer< T >::buffer ( T * p = nullptr,
std::size_t sz = 0,
std::size_t cap = 0 )
inlineprotected
15408 : ptr_(p),
15409 size_(sz),
15410 capacity_(cap) {}

Member Function Documentation

◆ set()

template<typename T>
void internal::buffer< T >::set ( T * buf_data,
std::size_t buf_capacity )
inlineprotected

Sets the buffer data and capacity.

15413 {
15414 ptr_ = buf_data;
15415 capacity_ = buf_capacity;
15416 }
Here is the caller graph for this function:

◆ grow()

template<typename T>
virtual void internal::buffer< T >::grow ( std::size_t capacity)
protectedpure virtual

Increases the buffer capacity to hold at least capacity elements.

Implemented in basic_memory_buffer< T, SIZE, Allocator >, basic_memory_buffer< bigit, bigits_capacity >, basic_memory_buffer< char >, basic_memory_buffer< wchar_t >, and internal::container_buffer< Container >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ begin()

template<typename T>
T * internal::buffer< T >::begin ( )
inline
15429{ return ptr_; }

◆ end()

template<typename T>
T * internal::buffer< T >::end ( )
inline
15430{ return ptr_ + size_; }

◆ size()

template<typename T>
std::size_t internal::buffer< T >::size ( ) const
inline

Returns the size of this buffer.

15433{ return size_; }
Here is the caller graph for this function:

◆ capacity()

template<typename T>
std::size_t internal::buffer< T >::capacity ( ) const
inline

Returns the capacity of this buffer.

15436{ return capacity_; }
Here is the caller graph for this function:

◆ data() [1/2]

template<typename T>
T * internal::buffer< T >::data ( )
inline

Returns a pointer to the buffer data.

15439{ return ptr_; }

◆ data() [2/2]

template<typename T>
const T * internal::buffer< T >::data ( ) const
inline

Returns a pointer to the buffer data.

15442{ return ptr_; }

◆ resize()

template<typename T>
void internal::buffer< T >::resize ( std::size_t new_size)
inline

Resizes the buffer. If T is a POD type new elements may not be initialized.

15447 {
15449 size_ = new_size;
15450 }
void reserve(std::size_t new_capacity)
Definition duckdb.cpp:15456
Here is the call graph for this function:

◆ clear()

template<typename T>
void internal::buffer< T >::clear ( )
inline

Clears this buffer.

15453{ size_ = 0; }

◆ reserve()

template<typename T>
void internal::buffer< T >::reserve ( std::size_t new_capacity)
inline

Reserves space to store at least capacity elements.

15456 {
15457 if (new_capacity > capacity_) grow(new_capacity);
15458 }
virtual void grow(std::size_t capacity)=0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_back()

template<typename T>
void internal::buffer< T >::push_back ( const T & value)
inline
15460 {
15461 reserve(size_ + 1);
15462 ptr_[size_++] = value;
15463 }

◆ append()

template<typename T>
template<typename U>
template FMT_API void internal::buffer< T >::append ( const U * begin,
const U * end )

Appends data to the end of the buffer.

16808 {
16809 std::size_t new_size = size_ + to_unsigned(end - begin);
16811 std::uninitialized_copy(begin, end, make_checked(ptr_, capacity_) + size_);
16812 size_ = new_size;
16813}
Here is the call graph for this function:

◆ operator[]() [1/2]

template<typename T>
T & internal::buffer< T >::operator[] ( std::size_t index)
inline
15468{ return ptr_[index]; }

◆ operator[]() [2/2]

template<typename T>
const T & internal::buffer< T >::operator[] ( std::size_t index) const
inline
15469{ return ptr_[index]; }

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