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

#include <core.h>

+ Inheritance diagram for internal::basic_buffer< T >:

Public Types

typedef T value_type
 
typedef const T & const_reference
 

Public Member Functions

virtual ~basic_buffer ()
 
T * begin () FMT_NOEXCEPT
 
T * end () FMT_NOEXCEPT
 
std::size_t size () const FMT_NOEXCEPT
 
std::size_t capacity () const FMT_NOEXCEPT
 
T * data () FMT_NOEXCEPT
 
const T * data () const FMT_NOEXCEPT
 
void resize (std::size_t new_size)
 
void clear ()
 
void reserve (std::size_t new_capacity)
 
void push_back (const T &value)
 
template<typename U >
void append (const U *begin, const U *end)
 
T & operator[] (std::size_t index)
 
const T & operator[] (std::size_t index) const
 

Protected Member Functions

 basic_buffer (std::size_t sz) FMT_NOEXCEPT
 
 basic_buffer (T *p=FMT_NULL, std::size_t sz=0, std::size_t cap=0) FMT_NOEXCEPT
 
void set (T *buf_data, std::size_t buf_capacity) FMT_NOEXCEPT
 
virtual void grow (std::size_t capacity)=0
 

Detailed Description

template<typename T>
class internal::basic_buffer< T >

A contiguous memory buffer with an optional growing ability.

Definition at line 213 of file core.h.

Member Typedef Documentation

template<typename T>
typedef const T& internal::basic_buffer< T >::const_reference

Definition at line 240 of file core.h.

template<typename T>
typedef T internal::basic_buffer< T >::value_type

Definition at line 239 of file core.h.

Constructor & Destructor Documentation

template<typename T>
internal::basic_buffer< T >::basic_buffer ( std::size_t  sz)
inlineprotected

Definition at line 224 of file core.h.

template<typename T>
internal::basic_buffer< T >::basic_buffer ( T *  p = FMT_NULL,
std::size_t  sz = 0,
std::size_t  cap = 0 
)
inlineprotected

Definition at line 226 of file core.h.

template<typename T>
virtual internal::basic_buffer< T >::~basic_buffer ( )
inlinevirtual

Definition at line 242 of file core.h.

Member Function Documentation

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

Appends data to the end of the buffer.

Definition at line 394 of file format.h.

template<typename T>
T* internal::basic_buffer< T >::begin ( void  )
inline

Definition at line 244 of file core.h.

template<typename T>
std::size_t internal::basic_buffer< T >::capacity ( ) const
inline

Returns the capacity of this buffer.

Definition at line 251 of file core.h.

template<typename T>
void internal::basic_buffer< T >::clear ( )
inline

Clears this buffer.

Definition at line 268 of file core.h.

template<typename T>
T* internal::basic_buffer< T >::data ( )
inline

Returns a pointer to the buffer data.

Definition at line 254 of file core.h.

template<typename T>
const T* internal::basic_buffer< T >::data ( ) const
inline

Returns a pointer to the buffer data.

Definition at line 257 of file core.h.

template<typename T>
T* internal::basic_buffer< T >::end ( void  )
inline

Definition at line 245 of file core.h.

template<typename T>
virtual void internal::basic_buffer< T >::grow ( std::size_t  capacity)
protectedpure virtual

Increases the buffer capacity to hold at least capacity elements.

Implemented in basic_memory_buffer< T, SIZE, Allocator >, and internal::container_buffer< Container >.

template<typename T>
T& internal::basic_buffer< T >::operator[] ( std::size_t  index)
inline

Definition at line 285 of file core.h.

template<typename T>
const T& internal::basic_buffer< T >::operator[] ( std::size_t  index) const
inline

Definition at line 286 of file core.h.

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

Definition at line 276 of file core.h.

template<typename T>
void internal::basic_buffer< T >::reserve ( std::size_t  new_capacity)
inline

Reserves space to store at least capacity elements.

Definition at line 271 of file core.h.

template<typename T>
void internal::basic_buffer< T >::resize ( std::size_t  new_size)
inline

Resizes the buffer. If T is a POD type new elements may not be initialized.

Definition at line 262 of file core.h.

template<typename T>
void internal::basic_buffer< T >::set ( T *  buf_data,
std::size_t  buf_capacity 
)
inlineprotected

Sets the buffer data and capacity.

Definition at line 230 of file core.h.

template<typename T>
std::size_t internal::basic_buffer< T >::size ( void  ) const
inline

Returns the size of this buffer.

Definition at line 248 of file core.h.


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