Refers to an entry in-place in the queue. Entries may be discontiguous. More...
#include <inline_var_len_entry_queue.h>
Classes | |
class | iterator |
Public Types | |
using | value_type = T |
using | size_type = std::uint32_t |
using | pointer = const T * |
using | const_pointer = pointer |
using | reference = const T & |
using | const_reference = reference |
using | const_iterator = iterator |
Public Member Functions | |
constexpr | Entry (const Entry &)=default |
constexpr Entry & | operator= (const Entry &)=default |
const_reference | at (size_t index) const |
const_reference | operator[] (size_t index) const |
const_reference | front () const |
const_reference | back () const |
std::pair< span< const value_type >, span< const value_type > > | contiguous_data () const |
size_type | copy (T *dest, size_type count) const |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | end () const |
const_iterator | cend () const |
bool | empty () const |
size_type | size () const |
Friends | |
class | BasicInlineVarLenEntryQueue |
Refers to an entry in-place in the queue. Entries may be discontiguous.
|
inline |
Entries may be stored in up to two segments, so this returns spans refering to both portions of the entry. If the entry is contiguous, the second span is empty.
|
inline |
Copies the contents of the entry to the provided buffer. The entry may be split into two regions; this serializes it into one buffer.
entry | The entry whose contents to copy |
dest | The buffer into which to copy the serialized entry |
count | Copy up to this many bytes; must not be larger than the dest buffer, but may be larger than the entry |
Copying with copy()
is likely more efficient than an iterator-based copy with std::copy()
, since copy()
uses one or two memcpy
calls instead of copying byte-by-byte.