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

#include <core.h>

Inheritance diagram for 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)
 
auto begin () FMT_NOEXCEPT -> T *
 
auto begin () const FMT_NOEXCEPT -> const T *
 
 buffer (const buffer &)=delete
 
auto capacity () const FMT_NOEXCEPT -> size_t
 
void clear ()
 
auto data () FMT_NOEXCEPT -> T *
 
auto data () const FMT_NOEXCEPT -> const T *
 
auto end () FMT_NOEXCEPT -> T *
 
auto end () const FMT_NOEXCEPT -> const T *
 
void operator= (const buffer &)=delete
 
template<typename I >
auto operator[] (I index) -> T &
 
template<typename I >
auto operator[] (I index) const -> const T &
 
void push_back (const T &value)
 
auto size () const FMT_NOEXCEPT -> size_t
 
void try_reserve (size_t new_capacity)
 
void try_resize (size_t count)
 

Protected Member Functions

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

Private Attributes

size_t capacity_
 
T * ptr_
 
size_t size_
 

Detailed Description

template<typename T>
class 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.

Definition at line 760 of file core.h.

Member Typedef Documentation

◆ const_reference

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

Definition at line 790 of file core.h.

◆ value_type

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

Definition at line 789 of file core.h.

Constructor & Destructor Documentation

◆ buffer() [1/4]

template<typename T>
buffer< T >::buffer ( size_t  sz)
inlineprotected

Definition at line 769 of file core.h.

◆ buffer() [2/4]

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

Definition at line 771 of file core.h.

◆ ~buffer()

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

◆ buffer() [3/4]

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

◆ buffer() [4/4]

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

Member Function Documentation

◆ append()

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

Appends data to the end of the buffer.

Definition at line 577 of file format.h.

◆ begin() [1/2]

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

Definition at line 795 of file core.h.

◆ begin() [2/2]

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

Definition at line 798 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 805 of file core.h.

◆ clear()

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

Clears this buffer.

Definition at line 814 of file core.h.

◆ data() [1/2]

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

Returns a pointer to the buffer data.

Definition at line 808 of file core.h.

◆ data() [2/2]

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

Returns a pointer to the buffer data.

Definition at line 811 of file core.h.

◆ end() [1/2]

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

Definition at line 796 of file core.h.

◆ end() [2/2]

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

Definition at line 799 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 839 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 840 of file core.h.

◆ push_back()

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

Definition at line 831 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 780 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 802 of file core.h.

◆ try_reserve()

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

Definition at line 827 of file core.h.

◆ try_resize()

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

Definition at line 818 of file core.h.

Member Data Documentation

◆ capacity_

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

Definition at line 764 of file core.h.

◆ ptr_

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

Definition at line 762 of file core.h.

◆ size_

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

Definition at line 763 of file core.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:12:54