Clementine
Public Types | Public Member Functions | Protected Member Functions | List of all members
detail::buffer< T > Class Template Referenceabstract

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

#include <core.h>

Inheritance diagram for detail::buffer< T >:
Inheritance graph
[legend]

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...
 

Detailed Description

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

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.

Member Function Documentation

◆ append()

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

Appends data to the end of the buffer.

◆ capacity()

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

Returns the capacity of this buffer.

◆ clear()

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

Clears this buffer.

◆ data() [1/2]

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

Returns a pointer to the buffer data.

◆ data() [2/2]

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

Returns a pointer to the buffer data.

◆ grow()

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

◆ set()

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

Sets the buffer data and capacity.

◆ size()

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

Returns the size of this buffer.


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