SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
|
A contiguous memory buffer with an optional growing ability. More...
#include <core.h>
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 * |
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 | |
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... | |
virtual FMT_CONSTEXPR20 void | grow (size_t capacity)=0 |
Increases the buffer capacity to hold at least capacity elements. More... | |
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
.
template FMT_API void buffer< T >::append | ( | const U * | begin, |
const U * | end | ||
) |
Appends data to the end of the buffer.
|
inline |
Returns the capacity of this buffer.
|
inline |
Clears this buffer.
|
inline |
Returns a pointer to the buffer data.
|
inline |
Returns a pointer to the buffer data.
|
protectedpure virtual |
Increases the buffer capacity to hold at least capacity elements.
Implemented in counting_buffer< T >, iterator_buffer< std::back_insert_iterator< Container >, enable_if_t< is_contiguous< Container >::value, typename Container::value_type > >, iterator_buffer< T *, T >, iterator_buffer< T *, T, fixed_buffer_traits >, and iterator_buffer< OutputIt, T, Traits >.
|
inlineprotected |
Sets the buffer data and capacity.
|
inline |
Returns the size of this buffer.