spdlog
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
buffer< T > Class Template Referenceabstract

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

Definition at line 749 of file core.h.

#include <core.h>

Inheritance diagram for buffer< T >:
[legend]

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 () FMT_NOEXCEPT -> T *
 
auto end () FMT_NOEXCEPT -> T *
 
auto begin () const FMT_NOEXCEPT -> const T *
 
auto end () const FMT_NOEXCEPT -> const T *
 
auto size () const FMT_NOEXCEPT -> size_t
 
auto capacity () const FMT_NOEXCEPT -> size_t
 
auto data () FMT_NOEXCEPT -> T *
 
auto data () const FMT_NOEXCEPT -> const T *
 
void clear ()
 
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)
 
template<typename I >
auto operator[] (I index) -> T &
 
template<typename I >
auto operator[] (I index) const -> const T &
 
template<typename U >
void append (const U *begin, const U *end)
 

Protected Member Functions

 FMT_MSC_WARNING (suppress :26495) buffer(size_t sz) FMT_NOEXCEPT
 
 buffer (T *p=nullptr, size_t sz=0, size_t cap=0) FMT_NOEXCEPT
 
 ~buffer ()=default
 
 buffer (buffer &&)=default
 
void set (T *buf_data, size_t buf_capacity) FMT_NOEXCEPT
 
virtual void grow (size_t capacity)=0
 

Private Attributes

Tptr_
 
size_t size_
 
size_t capacity_
 

Member Typedef Documentation

◆ const_reference

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

Definition at line 779 of file core.h.

◆ value_type

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

Definition at line 778 of file core.h.

Constructor & Destructor Documentation

◆ buffer() [1/3]

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

Definition at line 760 of file core.h.

◆ ~buffer()

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

◆ buffer() [2/3]

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

◆ buffer() [3/3]

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

Member Function Documentation

◆ append() [1/2]

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

Appends data to the end of the buffer.

◆ append() [2/2]

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

Definition at line 577 of file format.h.

◆ begin() [1/2]

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

Definition at line 787 of file core.h.

◆ begin() [2/2]

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

Definition at line 784 of file core.h.

◆ capacity()

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

Returns the capacity of this buffer.

Definition at line 794 of file core.h.

◆ clear()

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

Clears this buffer.

Definition at line 803 of file core.h.

◆ data() [1/2]

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

Returns a pointer to the buffer data.

Definition at line 800 of file core.h.

◆ data() [2/2]

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

Returns a pointer to the buffer data.

Definition at line 797 of file core.h.

◆ end() [1/2]

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

Definition at line 788 of file core.h.

◆ end() [2/2]

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

Definition at line 785 of file core.h.

◆ FMT_MSC_WARNING()

template<typename T >
buffer< T >::FMT_MSC_WARNING ( suppress :26495  )
inlineprotected

Definition at line 757 of file core.h.

◆ grow()

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

◆ operator=()

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

◆ operator[]() [1/2]

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

Definition at line 828 of file core.h.

◆ operator[]() [2/2]

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

Definition at line 829 of file core.h.

◆ push_back()

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

Definition at line 820 of file core.h.

◆ set()

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

Sets the buffer data and capacity.

Definition at line 769 of file core.h.

◆ size()

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

Returns the size of this buffer.

Definition at line 791 of file core.h.

◆ try_reserve()

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

Definition at line 816 of file core.h.

◆ try_resize()

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

Definition at line 807 of file core.h.

Member Data Documentation

◆ capacity_

template<typename T >
size_t buffer< T >::capacity_
private

Definition at line 753 of file core.h.

◆ ptr_

template<typename T >
T* buffer< T >::ptr_
private

Definition at line 751 of file core.h.

◆ size_

template<typename T >
size_t buffer< T >::size_
private

Definition at line 752 of file core.h.


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