WPILibC++ 2023.4.3-108-ge5452e3
buffer< T > Class Template Referenceabstract

\rst A contiguous memory buffer with an optional growing ability. More...

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/fmtlib/include/fmt/core.h>

Inheritance diagram for buffer< T >:
iterator_buffer< OutputIt, T, Traits > iterator_buffer< T *, T > iterator_buffer< T *, T, fixed_buffer_traits >

Public Types

using value_type = T
 
using const_reference = const T &
 

Public Member Functions

 buffer (const buffer &)=delete
 
void operator= (const buffer &)=delete
 
auto begin () noexcept -> T *
 
auto end () noexcept -> T *
 
auto begin () const noexcept -> const T *
 
auto end () const noexcept -> const T *
 
constexpr auto size () const noexcept -> size_t
 Returns the size of this buffer. More...
 
constexpr auto capacity () const noexcept -> size_t
 Returns the capacity of this buffer. More...
 
FMT_CONSTEXPR auto data () noexcept -> T *
 Returns a pointer to the buffer data. More...
 
FMT_CONSTEXPR auto data () const noexcept -> const T *
 Returns a pointer to the buffer data. More...
 
void clear ()
 Clears this buffer. More...
 
FMT_CONSTEXPR20 void try_resize (size_t count)
 
FMT_CONSTEXPR20 void try_reserve (size_t new_capacity)
 
FMT_CONSTEXPR20 void push_back (const T &value)
 
template<typename U >
void append (const U *begin, const U *end)
 Appends data to the end of the buffer. More...
 
template<typename Idx >
FMT_CONSTEXPR auto operator[] (Idx index) -> T &
 
template<typename Idx >
FMT_CONSTEXPR auto operator[] (Idx index) const -> const T &
 

Protected Member Functions

 buffer (size_t sz) noexcept
 
FMT_CONSTEXPR20 buffer (T *p=nullptr, size_t sz=0, size_t cap=0) noexcept
 
FMT_CONSTEXPR20 ~buffer ()=default
 
 buffer (buffer &&)=default
 
FMT_CONSTEXPR void set (T *buf_data, size_t buf_capacity) noexcept
 Sets the buffer data and capacity. More...
 
virtual FMT_CONSTEXPR20 void grow (size_t capacity)=0
 Increases the buffer capacity to hold at least capacity elements. More...
 

Detailed Description

template<typename T>
class buffer< T >

\rst A contiguous memory buffer with an optional growing ability.

It is an internal class and shouldn't be used directly, only via ~fmtbasic_memory_buffer. \endrst

Member Typedef Documentation

◆ const_reference

template<typename T >
using buffer< T >::const_reference = const T&

◆ value_type

template<typename T >
using buffer< T >::value_type = T

Constructor & Destructor Documentation

◆ buffer() [1/4]

template<typename T >
buffer< T >::buffer ( size_t  sz)
inlineprotectednoexcept

◆ buffer() [2/4]

template<typename T >
FMT_CONSTEXPR20 buffer< T >::buffer ( T *  p = nullptr,
size_t  sz = 0,
size_t  cap = 0 
)
inlineprotectednoexcept

◆ ~buffer()

template<typename T >
FMT_CONSTEXPR20 buffer< T >::~buffer ( )
protecteddefault

◆ buffer() [3/4]

template<typename T >
buffer< T >::buffer ( buffer< T > &&  )
protecteddefault

◆ buffer() [4/4]

template<typename T >
buffer< T >::buffer ( const buffer< T > &  )
delete

Member Function Documentation

◆ append()

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

Appends data to the end of the buffer.

◆ begin() [1/2]

template<typename T >
auto buffer< T >::begin ( ) const -> const T*
inlinenoexcept

◆ begin() [2/2]

template<typename T >
auto buffer< T >::begin ( ) -> T*
inlinenoexcept

◆ capacity()

template<typename T >
constexpr auto buffer< T >::capacity ( ) const -> size_t
inlineconstexprnoexcept

Returns the capacity of this buffer.

◆ clear()

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

Clears this buffer.

◆ data() [1/2]

template<typename T >
FMT_CONSTEXPR auto buffer< T >::data ( ) const -> const T*
inlinenoexcept

Returns a pointer to the buffer data.

◆ data() [2/2]

template<typename T >
FMT_CONSTEXPR auto buffer< T >::data ( ) -> T*
inlinenoexcept

Returns a pointer to the buffer data.

◆ end() [1/2]

template<typename T >
auto buffer< T >::end ( ) const -> const T*
inlinenoexcept

◆ end() [2/2]

template<typename T >
auto buffer< T >::end ( ) -> T*
inlinenoexcept

◆ grow()

◆ operator=()

template<typename T >
void buffer< T >::operator= ( const buffer< T > &  )
delete

◆ operator[]() [1/2]

template<typename T >
template<typename Idx >
FMT_CONSTEXPR auto buffer< T >::operator[] ( Idx  index) -> T&
inline

◆ operator[]() [2/2]

template<typename T >
template<typename Idx >
FMT_CONSTEXPR auto buffer< T >::operator[] ( Idx  index) const -> const T&
inline

◆ push_back()

template<typename T >
FMT_CONSTEXPR20 void buffer< T >::push_back ( const T &  value)
inline

◆ set()

template<typename T >
FMT_CONSTEXPR void buffer< T >::set ( T *  buf_data,
size_t  buf_capacity 
)
inlineprotectednoexcept

Sets the buffer data and capacity.

◆ size()

template<typename T >
constexpr auto buffer< T >::size ( ) const -> size_t
inlineconstexprnoexcept

Returns the size of this buffer.

◆ try_reserve()

template<typename T >
FMT_CONSTEXPR20 void buffer< T >::try_reserve ( size_t  new_capacity)
inline

◆ try_resize()

template<typename T >
FMT_CONSTEXPR20 void buffer< T >::try_resize ( size_t  count)
inline

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