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

#include <core.h>

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

Public Types

using const_reference = const T &
 
using value_type = T
 

Public Member Functions

template<typename U >
void append (const U *begin, const U *end)
 
FMT_INLINE auto begin () const noexcept -> const T *
 
FMT_INLINE auto begin () noexcept -> T *
 
 buffer (const buffer &)=delete
 
constexpr auto capacity () const noexcept -> size_t
 
void clear ()
 
FMT_CONSTEXPR auto data () const noexcept -> const T *
 
FMT_CONSTEXPR auto data () noexcept -> T *
 
FMT_INLINE auto end () const noexcept -> const T *
 
FMT_INLINE auto end () noexcept -> T *
 
void operator= (const buffer &)=delete
 
template<typename Idx >
FMT_CONSTEXPR auto operator[] (Idx index) -> T &
 
template<typename Idx >
FMT_CONSTEXPR auto operator[] (Idx index) const -> const T &
 
FMT_CONSTEXPR20 void push_back (const T &value)
 
constexpr auto size () const noexcept -> size_t
 
FMT_CONSTEXPR20 void try_reserve (size_t new_capacity)
 
FMT_CONSTEXPR20 void try_resize (size_t count)
 

Protected Member Functions

 buffer (buffer &&)=default
 
FMT_CONSTEXPR buffer (size_t sz) noexcept
 
FMT_CONSTEXPR20 buffer (T *p=nullptr, size_t sz=0, size_t cap=0) noexcept
 
virtual FMT_CONSTEXPR20 void grow (size_t capacity)=0
 
FMT_CONSTEXPR void set (T *buf_data, size_t buf_capacity) noexcept
 
FMT_CONSTEXPR20 ~buffer ()=default
 

Private Attributes

size_t capacity_
 
T * ptr_
 
size_t size_
 

Detailed Description

template<typename T>
class detail::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 816 of file core.h.

Member Typedef Documentation

◆ const_reference

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

Definition at line 845 of file core.h.

◆ value_type

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

Definition at line 844 of file core.h.

Constructor & Destructor Documentation

◆ buffer() [1/4]

template<typename T >
FMT_CONSTEXPR detail::buffer< T >::buffer ( size_t  sz)
inlineprotectednoexcept

Definition at line 825 of file core.h.

◆ buffer() [2/4]

template<typename T >
FMT_CONSTEXPR20 detail::buffer< T >::buffer ( T *  p = nullptr,
size_t  sz = 0,
size_t  cap = 0 
)
inlineprotectednoexcept

Definition at line 827 of file core.h.

◆ ~buffer()

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

◆ buffer() [3/4]

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

◆ buffer() [4/4]

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

Member Function Documentation

◆ append()

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

Appends data to the end of the buffer.

◆ begin() [1/2]

template<typename T >
FMT_INLINE auto detail::buffer< T >::begin ( ) const -> const T*
inlinenoexcept

Definition at line 853 of file core.h.

◆ begin() [2/2]

template<typename T >
FMT_INLINE auto detail::buffer< T >::begin ( ) -> T*
inlinenoexcept

Definition at line 850 of file core.h.

◆ capacity()

template<typename T >
constexpr auto detail::buffer< T >::capacity ( ) const -> size_t
inlineconstexprnoexcept

Returns the capacity of this buffer.

Definition at line 860 of file core.h.

◆ clear()

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

Clears this buffer.

Definition at line 867 of file core.h.

◆ data() [1/2]

template<typename T >
FMT_CONSTEXPR auto detail::buffer< T >::data ( ) const -> const T*
inlinenoexcept

Definition at line 864 of file core.h.

◆ data() [2/2]

template<typename T >
FMT_CONSTEXPR auto detail::buffer< T >::data ( ) -> T*
inlinenoexcept

Returns a pointer to the buffer data (not null-terminated).

Definition at line 863 of file core.h.

◆ end() [1/2]

template<typename T >
FMT_INLINE auto detail::buffer< T >::end ( ) const -> const T*
inlinenoexcept

Definition at line 854 of file core.h.

◆ end() [2/2]

template<typename T >
FMT_INLINE auto detail::buffer< T >::end ( ) -> T*
inlinenoexcept

Definition at line 851 of file core.h.

◆ grow()

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

◆ operator=()

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

◆ operator[]() [1/2]

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

Definition at line 892 of file core.h.

◆ operator[]() [2/2]

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

Definition at line 896 of file core.h.

◆ push_back()

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

Definition at line 884 of file core.h.

◆ set()

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

Sets the buffer data and capacity.

Definition at line 834 of file core.h.

◆ size()

template<typename T >
constexpr auto detail::buffer< T >::size ( ) const -> size_t
inlineconstexprnoexcept

Returns the size of this buffer.

Definition at line 857 of file core.h.

◆ try_reserve()

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

Definition at line 880 of file core.h.

◆ try_resize()

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

Definition at line 871 of file core.h.

Member Data Documentation

◆ capacity_

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

Definition at line 820 of file core.h.

◆ ptr_

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

Definition at line 818 of file core.h.

◆ size_

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

Definition at line 819 of file core.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:30