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

Detailed Description

template<typename T = char>
class counting_buffer< T >

Definition at line 924 of file core.h.

#include <core.h>

Inheritance diagram for counting_buffer< T >:
[legend]

Public Types

using value_type = T
 
using const_reference = const T &
 

Public Member Functions

 counting_buffer ()
 
auto count () -> size_t
 
auto begin () FMT_NOEXCEPT -> T *
 
auto begin () const FMT_NOEXCEPT -> const T *
 
auto end () FMT_NOEXCEPT -> 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 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 &
 

Protected Member Functions

void grow (size_t) final FMT_OVERRIDE
 
 FMT_MSC_WARNING (suppress :26495) buffer(size_t sz) FMT_NOEXCEPT
 
void set (T *buf_data, size_t buf_capacity) FMT_NOEXCEPT
 

Private Types

enum  { buffer_size = 256 }
 

Private Attributes

T data_ [buffer_size]
 
size_t count_ = 0
 
Tptr_
 
size_t size_
 
size_t capacity_
 

Member Typedef Documentation

◆ const_reference

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

Definition at line 779 of file core.h.

◆ value_type

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

Definition at line 778 of file core.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename T = char>
anonymous enum
private
Enumerator
buffer_size 

Definition at line 926 of file core.h.

Constructor & Destructor Documentation

◆ counting_buffer()

template<typename T = char>
counting_buffer< T >::counting_buffer ( )
inline

Definition at line 938 of file core.h.

Member Function Documentation

◆ append() [1/2]

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

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 
)
inherited

Definition at line 577 of file format.h.

◆ begin() [1/2]

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

Definition at line 787 of file core.h.

◆ begin() [2/2]

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

Definition at line 784 of file core.h.

◆ capacity()

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

Returns the capacity of this buffer.

Definition at line 794 of file core.h.

◆ clear()

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

Clears this buffer.

Definition at line 803 of file core.h.

◆ count()

template<typename T = char>
auto counting_buffer< T >::count ( ) -> size_t
inline

Definition at line 940 of file core.h.

◆ data() [1/2]

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

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*
inlineinherited

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*
inlineinherited

Definition at line 788 of file core.h.

◆ end() [2/2]

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

Definition at line 785 of file core.h.

◆ FMT_MSC_WARNING()

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

Definition at line 757 of file core.h.

◆ grow()

template<typename T = char>
void counting_buffer< T >::grow ( size_t  capacity)
inlinefinalprotectedvirtual

Increases the buffer capacity to hold at least capacity elements.

Implements buffer< T >.

Definition at line 931 of file core.h.

◆ operator[]() [1/2]

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

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&
inlineinherited

Definition at line 829 of file core.h.

◆ push_back()

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

Definition at line 820 of file core.h.

◆ set()

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

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
inlineinherited

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)
inlineinherited

Definition at line 816 of file core.h.

◆ try_resize()

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

Definition at line 807 of file core.h.

Member Data Documentation

◆ capacity_

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

Definition at line 753 of file core.h.

◆ count_

template<typename T = char>
size_t counting_buffer< T >::count_ = 0
private

Definition at line 928 of file core.h.

◆ data_

template<typename T = char>
T counting_buffer< T >::data_[buffer_size]
private

Definition at line 927 of file core.h.

◆ ptr_

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

Definition at line 751 of file core.h.

◆ size_

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

Definition at line 752 of file core.h.


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