SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
counting_buffer< T > Class Template Referencefinal
Inheritance diagram for counting_buffer< T >:
buffer< T >

Public Member Functions

auto count () -> size_t
 
- Public Member Functions inherited from buffer< T >
 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 *
 
constexpr auto size () const FMT_NOEXCEPT -> size_t
 Returns the size of this buffer. More...
 
constexpr auto capacity () const FMT_NOEXCEPT -> size_t
 Returns the capacity of this buffer. More...
 
FMT_CONSTEXPR auto data () FMT_NOEXCEPT -> T *
 Returns a pointer to the buffer data. More...
 
FMT_CONSTEXPR auto data () const FMT_NOEXCEPT -> const T *
 Returns a pointer to the buffer data. More...
 
void clear ()
 Clears this buffer. More...
 
FMT_CONSTEXPR20 void try_resize (size_t count)
 
FMT_CONSTEXPR20 void try_reserve (size_t new_capacity)
 
FMT_CONSTEXPR20 void push_back (const T &value)
 
template<typename U >
void append (const U *begin, const U *end)
 Appends data to the end of the buffer. More...
 
template<typename I >
FMT_CONSTEXPR auto operator[] (I index) -> T &
 
template<typename I >
FMT_CONSTEXPR auto operator[] (I index) const -> const T &
 

Protected Member Functions

FMT_CONSTEXPR20 void grow (size_t) override
 Increases the buffer capacity to hold at least capacity elements. More...
 
- Protected Member Functions inherited from buffer< T >
 buffer (size_t sz) FMT_NOEXCEPT
 
FMT_CONSTEXPR20 buffer (T *p=nullptr, size_t sz=0, size_t cap=0) FMT_NOEXCEPT
 
 buffer (buffer &&)=default
 
FMT_CONSTEXPR void set (T *buf_data, size_t buf_capacity) FMT_NOEXCEPT
 Sets the buffer data and capacity. More...
 

Additional Inherited Members

- Public Types inherited from buffer< T >
using value_type = T
 
using const_reference = const T &
 

Member Function Documentation

◆ grow()

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

Increases the buffer capacity to hold at least capacity elements.

Implements buffer< T >.