HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
buffer< T > Class Template Referenceabstract

#include <core.h>

+ Inheritance diagram for buffer< T >:

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 &
 

Protected Member Functions

 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
 

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

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

Definition at line 790 of file core.h.

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

Definition at line 789 of file core.h.

Constructor & Destructor Documentation

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

Definition at line 769 of file core.h.

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.

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

Member Function Documentation

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.

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

Definition at line 795 of file core.h.

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

Definition at line 798 of file core.h.

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.

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

Clears this buffer.

Definition at line 814 of file core.h.

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

Returns a pointer to the buffer data.

Definition at line 808 of file core.h.

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.

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

Definition at line 796 of file core.h.

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

Definition at line 799 of file core.h.

template<typename T>
virtual void buffer< T >::grow ( size_t  capacity)
protectedpure virtual
template<typename T>
void buffer< T >::operator= ( const buffer< T > &  )
delete
template<typename T>
template<typename I >
auto buffer< T >::operator[] ( index) -> T&
inline

Definition at line 839 of file core.h.

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

Definition at line 840 of file core.h.

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

Definition at line 831 of file core.h.

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.

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

Returns the size of this buffer.

Definition at line 802 of file core.h.

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

Definition at line 827 of file core.h.

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

Definition at line 818 of file core.h.


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