A Chunk
-oriented view of a MultiBuf
.
More...
#include <multibuf.h>
|
using | element_type = Chunk |
|
using | value_type = Chunk |
|
using | pointer = Chunk * |
|
using | reference = Chunk & |
|
using | const_pointer = const Chunk * |
|
using | difference_type = std::ptrdiff_t |
|
using | const_reference = const Chunk & |
|
using | size_type = std::size_t |
|
|
constexpr | MultiBufChunks (Chunk *first_chunk) |
|
| ~MultiBufChunks () |
| This destructor will acquire a mutex and is not IRQ safe.
|
|
| PW_MODIFY_DIAGNOSTICS_PUSH () |
|
| PW_MODIFY_DIAGNOSTIC_GCC (ignored, "-Wmaybe-uninitialized") |
|
constexpr | MultiBufChunks (MultiBufChunks &&other) noexcept |
|
| PW_MODIFY_DIAGNOSTICS_POP () |
|
MultiBufChunks & | operator= (MultiBufChunks &&other) noexcept |
|
void | Release () noexcept |
|
void | PushSuffix (MultiBufChunks &&tail) |
|
Chunk * | Previous (Chunk *chunk) const |
|
A Chunk
-oriented view of a MultiBuf
.
◆ back()
Chunk & pw::multibuf::MultiBufChunks::back |
( |
| ) |
|
|
inline |
Returns a reference to the final chunk.
The behavior of this method is undefined when size() == 0
.
NOTE: this method is O(size())
.
◆ front()
constexpr Chunk & pw::multibuf::MultiBufChunks::front |
( |
| ) |
|
|
inlineconstexpr |
Returns a reference to the first chunk.
The behavior of this method is undefined when size() == 0
.
◆ insert()
Inserts chunk
into the specified position in the MultiBuf
. The Chunk
at position
will be after the new chunk.
This operation does not move any data and is O(Chunks().size())
.
Returns an iterator pointing to the newly-inserted Chunk
.
◆ Previous()
Chunk * pw::multibuf::MultiBufChunks::Previous |
( |
Chunk * |
chunk | ) |
const |
|
protected |
Returns the Chunk
preceding chunk
in this MultiBuf
.
Requires that this MultiBuf
is not empty, and that chunk
is either in MultiBuf
or is nullptr
, in which case the last Chunk
in MultiBuf
will be returned.
This operation is O(Chunks().size())
.
◆ push_back()
void pw::multibuf::MultiBufChunks::push_back |
( |
OwnedChunk && |
chunk | ) |
|
Pushes Chunk
onto the end of the MultiBuf
.
This operation does not move any data and is O(Chunks().size())
.
◆ push_front()
void pw::multibuf::MultiBufChunks::push_front |
( |
OwnedChunk && |
chunk | ) |
|
Pushes Chunk
onto the front of the MultiBuf
.
This operation does not move any data and is O(1)
.
◆ take()
Removes and returns Chunk
from the specified position.
This operation does not move any data and is O(Chunks().size())
.
Returns an iterator pointing to the Chunk
after the removed Chunk
, or Chunks().end()
if this was the last Chunk
in the MultiBuf
.
◆ take_front()
OwnedChunk pw::multibuf::MultiBufChunks::take_front |
( |
| ) |
|
Removes the first Chunk
.
This operation does not move any data and is O(1)
.
The documentation for this class was generated from the following file: