|
iffl
1.3.4
Implements Intrusive Flat Forward List container
|
Vocabulary type that describes a sub-buffer in a larger buffer, and portion of that sub-buffer actually used by the data. More...
#include <iffl_common.h>
Public Member Functions | |
| constexpr size_t | begin () const |
| Offset of the element buffer begin in a larger buffer. More... | |
| constexpr void | verify () const noexcept |
| Fail fast if range invariants are broken. | |
| constexpr size_t | data_size () const noexcept |
| Data size. More... | |
| constexpr size_t | buffer_size () const noexcept |
| Buffer size. More... | |
| constexpr size_t | unused_capacity () const noexcept |
| Size of unused buffer. More... | |
| void | fill_unused_capacity_data_ptr (char *data_ptr, int fill_byte) const noexcept |
| Fills unused part of buffer with fill_byte. More... | |
| void | zero_unused_capacity_data_ptr (char *data_ptr) const noexcept |
| Zeros unused part of buffer. More... | |
| void | fill_unused_capacity_container_ptr (char *container_ptr, int fill_byte) const noexcept |
| Fills unused part of buffer with fill_byte. More... | |
| void | zero_unused_capacity_container_ptr (char *container_ptr) const noexcept |
| Zeros unused part of buffer. More... | |
| constexpr bool | buffer_contains (size_t position) const noexcept |
| Tells if position falls into the buffer. More... | |
| constexpr bool | data_contains (size_t position) const noexcept |
| Tells if position falls into the data buffer. More... | |
Public Attributes | |
| size_t | buffer_begin { 0 } |
| Starting offset of element in a buffer Element always starts at the beginning of the buffer. | |
| size_t | data_end { 0 } |
| Offset in the buffer where data end. | |
| size_t | buffer_end { 0 } |
| Offset of the end of the buffer Next element of the flat list starts at this offset. | |
Vocabulary type that describes a sub-buffer in a larger buffer, and portion of that sub-buffer actually used by the data.
Following picture explains that concept
unused space between data_end and buffer_end is either reserved space for the element in the buffer and/or padding to keep next element aligned. This vocabulary type is a convenient building block for flat list. When we move elements in the buffer it is more convenient to operate on relative offsets in the buffer.
|
inline |
Offset of the element buffer begin in a larger buffer.
|
inlinenoexcept |
Tells if position falls into the buffer.
| position | - position offset in the parent buffer |
|
inlinenoexcept |
Buffer size.
|
inlinenoexcept |
Tells if position falls into the data buffer.
| position | - position offset in the parent buffer |
|
inlinenoexcept |
Data size.
|
inlinenoexcept |
Fills unused part of buffer with fill_byte.
| container_ptr | - a pointer to the buffer start |
| fill_byte | - a value to fill bytes with |
|
inlinenoexcept |
Fills unused part of buffer with fill_byte.
| data_ptr | - a pointer to the element start |
| fill_byte | - a value to fill bytes with |
|
inlinenoexcept |
Size of unused buffer.
|
inlinenoexcept |
Zeros unused part of buffer.
| container_ptr | - a pointer to the buffer start |
|
inlinenoexcept |
Zeros unused part of buffer.
| data_ptr | - a pointer to the element start |
1.8.15