Clementine
|
A contiguous memory buffer with an optional growing ability. More...
#include <core.h>
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 |
const T * | begin () const FMT_NOEXCEPT |
const T * | end () const FMT_NOEXCEPT |
size_t | size () const FMT_NOEXCEPT |
Returns the size of this buffer. More... | |
size_t | capacity () const FMT_NOEXCEPT |
Returns the capacity of this buffer. More... | |
T * | data () FMT_NOEXCEPT |
Returns a pointer to the buffer data. More... | |
const T * | data () const FMT_NOEXCEPT |
Returns a pointer to the buffer data. More... | |
void | clear () |
Clears this buffer. More... | |
void | try_resize (size_t count) |
void | try_reserve (size_t new_capacity) |
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 I > | |
T & | operator[] (I index) |
template<typename I > | |
const T & | operator[] (I index) const |
Protected Member Functions | |
buffer (size_t sz) FMT_NOEXCEPT | |
buffer (T *p=nullptr, size_t sz=0, size_t cap=0) FMT_NOEXCEPT | |
void | set (T *buf_data, size_t buf_capacity) FMT_NOEXCEPT |
Sets the buffer data and capacity. More... | |
virtual void | grow (size_t capacity)=0 |
Increases the buffer capacity to hold at least capacity elements. More... | |
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
.
template FMT_API void detail::buffer< T >::append | ( | const U * | begin, |
const U * | end | ||
) |
Appends data to the end of the buffer.
|
inline |
Returns the capacity of this buffer.
|
inline |
Clears this buffer.
|
inline |
Returns a pointer to the buffer data.
|
inline |
Returns a pointer to the buffer data.
|
protectedpure virtual |
Increases the buffer capacity to hold at least capacity elements.
Implemented in detail::counting_buffer< T >, detail::iterator_buffer< std::back_insert_iterator< Container >, enable_if_t< is_contiguous< Container >::value, typename Container::value_type > >, detail::iterator_buffer< T *, T >, detail::iterator_buffer< OutputIt, T, Traits >, basic_memory_buffer< T, SIZE, Allocator >, basic_memory_buffer< bigit, bigits_capacity >, basic_memory_buffer< Char >, and basic_memory_buffer< wchar_t >.
|
inlineprotected |
Sets the buffer data and capacity.
|
inline |
Returns the size of this buffer.