WPILibC++ 2023.4.3-108-ge5452e3
basic_memory_buffer< T, SIZE, Allocator > Class Template Referencefinal

\rst A dynamically growing memory buffer for trivially copyable/constructible types with the first SIZE elements stored in the object itself. More...

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

Inheritance diagram for basic_memory_buffer< T, SIZE, Allocator >:

Public Types

using value_type = T
 
using const_reference = const T &
 

Public Member Functions

FMT_CONSTEXPR20 basic_memory_buffer (const Allocator &alloc=Allocator())
 
FMT_CONSTEXPR20 ~basic_memory_buffer ()
 
FMT_CONSTEXPR20 basic_memory_buffer (basic_memory_buffer &&other) noexcept
 \rst Constructs a :class:fmt::basic_memory_buffer object moving the content of the other object to it. More...
 
auto operator= (basic_memory_buffer &&other) noexcept -> basic_memory_buffer &
 \rst Moves the content of the other basic_memory_buffer object to this one. More...
 
auto get_allocator () const -> Allocator
 
FMT_CONSTEXPR20 void resize (size_t count)
 Resizes the buffer to contain count elements. More...
 
void reserve (size_t new_capacity)
 Increases the buffer capacity to new_capacity. More...
 
template<typename ContiguousRange >
void append (const ContiguousRange &range)
 

Protected Member Functions

FMT_CONSTEXPR20 void grow (size_t size) override
 

Detailed Description

template<typename T, size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
class basic_memory_buffer< T, SIZE, Allocator >

\rst A dynamically growing memory buffer for trivially copyable/constructible types with the first SIZE elements stored in the object itself.

You can use the memory_buffer type alias for char instead.

Example**::

auto out = fmt::memory_buffer(); format_to(std::back_inserter(out), "The answer is {}.", 42);

This will append the following output to the out object:

.. code-block:: none

The answer is 42.

The output can be converted to an std::string with to_string(out). \endrst

Member Typedef Documentation

◆ const_reference

template<typename T , size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
using basic_memory_buffer< T, SIZE, Allocator >::const_reference = const T&

◆ value_type

template<typename T , size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
using basic_memory_buffer< T, SIZE, Allocator >::value_type = T

Constructor & Destructor Documentation

◆ basic_memory_buffer() [1/2]

template<typename T , size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
FMT_CONSTEXPR20 basic_memory_buffer< T, SIZE, Allocator >::basic_memory_buffer ( const Allocator &  alloc = Allocator())
inlineexplicit

◆ ~basic_memory_buffer()

template<typename T , size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
FMT_CONSTEXPR20 basic_memory_buffer< T, SIZE, Allocator >::~basic_memory_buffer ( )
inline

◆ basic_memory_buffer() [2/2]

template<typename T , size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
FMT_CONSTEXPR20 basic_memory_buffer< T, SIZE, Allocator >::basic_memory_buffer ( basic_memory_buffer< T, SIZE, Allocator > &&  other)
inlinenoexcept

\rst Constructs a :class:fmt::basic_memory_buffer object moving the content of the other object to it.

\endrst

Member Function Documentation

◆ append()

template<typename T , size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
template<typename ContiguousRange >
void basic_memory_buffer< T, SIZE, Allocator >::append ( const ContiguousRange &  range)
inline

◆ get_allocator()

template<typename T , size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
auto basic_memory_buffer< T, SIZE, Allocator >::get_allocator ( ) const -> Allocator
inline

◆ grow()

template<typename T , size_t SIZE, typename Allocator >
FMT_CONSTEXPR20 void basic_memory_buffer< T, SIZE, Allocator >::grow ( size_t  size)
overrideprotected

◆ operator=()

template<typename T , size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
auto basic_memory_buffer< T, SIZE, Allocator >::operator= ( basic_memory_buffer< T, SIZE, Allocator > &&  other) -> basic_memory_buffer&
inlinenoexcept

\rst Moves the content of the other basic_memory_buffer object to this one.

\endrst

◆ reserve()

template<typename T , size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
void basic_memory_buffer< T, SIZE, Allocator >::reserve ( size_t  new_capacity)
inline

Increases the buffer capacity to new_capacity.

◆ resize()

template<typename T , size_t SIZE = inline_buffer_size, typename Allocator = std::allocator<T>>
FMT_CONSTEXPR20 void basic_memory_buffer< T, SIZE, Allocator >::resize ( size_t  count)
inline

Resizes the buffer to contain count elements.

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


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