iffl
1.3.4
Implements Intrusive Flat Forward List container
|
intrusive flat forward list More...
Namespaces | |
mpl | |
intrusive flat forward list | |
Classes | |
class | attach_buffer |
Helper class used as a parameter in flat_forward_list constructor to designate that it should take ownership of the buffer rather than make a copy. More... | |
class | buffer_t |
A set of pointers describing state of the buffer containing flat forward list. More... | |
class | compressed_pair |
Empty Base Class Optimization EBCO helper. More... | |
class | compressed_pair< T1, T2, false > |
Specialization for the case when Empty Base Class Optimization EBCO would not work. More... | |
class | debug_memory_resource |
implements std::pmr::memory_resource interface. More... | |
class | default_validate_element_fn |
class | flat_forward_list |
Intrusive flat forward list container. More... | |
class | flat_forward_list_iterator_t |
THis class implements forward iterator for intrusive flat forward list. More... | |
class | flat_forward_list_ref |
Non owning container for flat forward list. More... | |
class | flat_forward_list_sizes |
Describes buffer used by container. More... | |
class | flat_forward_list_traits |
traits for an elements that are in the flat forward list More... | |
class | flat_forward_list_traits_traits |
traits for flat_forward_list_traits More... | |
class | input_buffer_memory_resource |
implements std::pmr::memory_resource interface. More... | |
class | noop_validate_element_fn |
class | offset_with_aligment |
Vocabulary type that describes an offset in a larger buffer and template parameter that specifies element's type alignment requirements. More... | |
class | one_then_variadic_args_t |
Tag type for constructing first from one argument, constructing second from remaining arguments. More... | |
class | range |
Vocabulary type that describes a sub-buffer in a larger buffer, and portion of that sub-buffer actually used by the data. More... | |
class | range_with_alighment |
Vocabulary type that describes a sub-buffer in a larger buffer and portion of that sub-buffer actually used by the data. More... | |
class | scope_guard |
template class that can be parametrized with a functor or a lambda that it will call in destructor. More... | |
class | size_with_padding |
Vocabulary type that describes an size and template parameter that specifies element's type alignment requirements. More... | |
class | zero_then_variadic_args_t |
Tag type for value - initializing first, constructing second from remaining arguments. More... | |
Typedefs | |
using | buffer_ref = buffer_t< char > |
Non const flat forward list buffer. | |
using | buffer_view = buffer_t< char const > |
Const flat forward list buffer. | |
template<typename T , typename TT = flat_forward_list_traits<T>> | |
using | flat_forward_list_iterator = flat_forward_list_iterator_t< T, TT > |
non-const iterator More... | |
template<typename T , typename TT = flat_forward_list_traits<T>> | |
using | flat_forward_list_const_iterator = flat_forward_list_iterator_t< std::add_const_t< T >, TT > |
const iterator More... | |
template<typename T , typename TT = flat_forward_list_traits<T>> | |
using | flat_forward_list_view = flat_forward_list_ref< T const, TT > |
Constant view to flat forward list. | |
template<typename T , typename TT = flat_forward_list_traits<T>> | |
using | pmr_flat_forward_list = flat_forward_list< T, TT, FFL_PMR::polymorphic_allocator< char > > |
Use this typedef if you want to use container with polymorphic allocator. More... | |
Functions | |
template<typename T > | |
constexpr void | unused_variable ([[maybe_unused]] T const &) |
Restore saved min and max definition. More... | |
template<typename T > | |
constexpr void | unused_expression_result ([[maybe_unused]] T const &) |
Silence sensitizers warning about unused result of expression. More... | |
size_t const | ptr_to_size (void const *const ptr) |
Reinterprets pointer to void value as size_t value. More... | |
void *const | size_to_ptr (size_t size) |
Reinterprets size_t value as pointer to void. More... | |
constexpr size_t | roundup_size_to_alignment (size_t size, size_t alignment) noexcept |
Rounds up size to specified alignment. More... | |
template<typename T > | |
constexpr size_t | roundup_size_to_alignment (size_t size) noexcept |
Rounds up size to specified alignment. More... | |
void * | roundup_ptr_to_alignment (void *ptr, size_t alignment) noexcept |
Rounds up pointer to specified alignment. More... | |
template<typename T > | |
void * | roundup_ptr_to_alignment (void *ptr) noexcept |
Rounds up pointer to specified alignment. More... | |
void const * | roundup_ptr_to_alignment (void const *ptr, size_t alignment) noexcept |
Rounds up pointer to specified alignment. More... | |
template<typename T > | |
void const * | roundup_ptr_to_alignment (void const *ptr) noexcept |
Rounds up pointer to specified alignment. More... | |
void | copy_data (char *to_buffer, char const *from_buffer, size_t length) noexcept |
copies length bytes from from_buffer to to_buffer. source and destination buffers cannot overlap More... | |
void | move_data (char *to_buffer, char const *from_buffer, size_t length) noexcept |
copies length bytes from from_buffer to to_buffer. source and destination buffers can overlap More... | |
void | fill_buffer (char *buffer, int value, size_t length) noexcept |
sets "length" consecutive bytes of "to_buffer" to "value". More... | |
void | zero_buffer (char *buffer, size_t length) noexcept |
sets "length" consecutive bytes of "to_buffer" to 0. More... | |
size_t | distance (void const *begin, void const *end) noexcept |
sets "length" consecutive bytes of "to_buffer" to 0. More... | |
template<typename T > | |
char * | cast_to_char_ptr (T *p) noexcept |
Helper method to cast a pointer to a char *. More... | |
template<typename T > | |
void * | cast_to_void_ptr (T *p) noexcept |
Helper method to cast a pointer to a void *. More... | |
template<typename G > | |
constexpr auto | make_scope_guard (G &&g) |
Factory method for scoped_guard. More... | |
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>> | |
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > | flat_forward_list_validate_has_next_offset (char const *first, char const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept |
Forward declaration. More... | |
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>> | |
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > | flat_forward_list_validate_no_next_offset (char const *first, char const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept |
Forward declaration. More... | |
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>> | |
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > | flat_forward_list_validate (char const *first, char const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept |
Forward declaration. More... | |
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>> | |
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > | flat_forward_list_validate (char *first, char *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept |
Forward declaration. | |
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>> | |
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > | flat_forward_list_validate (T *first, T *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept |
Forward declaration. More... | |
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>> | |
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > | flat_forward_list_validate (T const *first, T const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept |
Forward declaration. More... | |
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>> | |
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > | flat_forward_list_validate (unsigned char const *first, unsigned char const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept |
Forward declaration. More... | |
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>> | |
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > | flat_forward_list_validate (unsigned char *first, unsigned char *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept |
Forward declaration. More... | |
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>> | |
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > | flat_forward_list_validate (void const *first, void const *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept |
Forward declaration. More... | |
template<typename T , typename TT = flat_forward_list_traits<T>, typename F = default_validate_element_fn<T, TT>> | |
constexpr std::pair< bool, flat_forward_list_ref< T, TT > > | flat_forward_list_validate (void *first, void *end, F const &validate_element_fn=default_validate_element_fn< T, TT >{}) noexcept |
Forward declaration. More... | |
template<typename T , typename TT > | |
void | swap (flat_forward_list_ref< T, TT > &lhs, flat_forward_list_ref< T, TT > &rhs) noexcept |
template<typename T , typename TT > | |
flat_forward_list_ref< T, TT >::iterator | begin (flat_forward_list_ref< T, TT > &c) noexcept |
template<typename T , typename TT > | |
flat_forward_list_ref< T, TT >::const_iterator | begin (flat_forward_list_ref< T, TT > const &c) noexcept |
template<typename T , typename TT > | |
flat_forward_list_ref< T, TT >::const_iterator | cbegin (flat_forward_list_ref< T, TT > const &c) noexcept |
template<typename T , typename TT > | |
flat_forward_list_ref< T, TT >::iterator | end (flat_forward_list_ref< T, TT > &c) noexcept |
template<typename T , typename TT > | |
flat_forward_list_ref< T, TT >::const_iterator | end (flat_forward_list_ref< T, TT > const &c) noexcept |
template<typename T , typename TT > | |
flat_forward_list_ref< T, TT >::const_iterator | cend (flat_forward_list_ref< T, TT > const &c) noexcept |
template<typename T , typename TT > | |
flat_forward_list_ref< T, TT >::iterator | last (flat_forward_list_ref< T, TT > &c) noexcept |
template<typename T , typename TT > | |
flat_forward_list_ref< T, TT >::const_iterator | last (flat_forward_list_ref< T, TT > const &c) noexcept |
template<typename T , typename TT > | |
flat_forward_list_ref< T, TT >::const_iterator | clast (flat_forward_list_ref< T, TT > const &c) noexcept |
template<typename T , typename TT , typename A > | |
void | swap (flat_forward_list< T, TT, A > &lhs, flat_forward_list< T, TT, A > &rhs) noexcept(std::allocator_traits< A >::propagate_on_container_swap::value||std::allocator_traits< A >::propagate_on_container_move_assignment::value) |
template<typename T , typename TT , typename A > | |
flat_forward_list< T, TT, A >::iterator | begin (flat_forward_list< T, TT, A > &c) noexcept |
template<typename T , typename TT , typename A > | |
flat_forward_list< T, TT, A >::const_iterator | begin (flat_forward_list< T, TT, A > const &c) noexcept |
template<typename T , typename TT , typename A > | |
flat_forward_list< T, TT, A >::const_iterator | cbegin (flat_forward_list< T, TT, A > const &c) noexcept |
template<typename T , typename TT , typename A > | |
flat_forward_list< T, TT, A >::iterator | end (flat_forward_list< T, TT, A > &c) noexcept |
template<typename T , typename TT , typename A > | |
flat_forward_list< T, TT, A >::const_iterator | end (flat_forward_list< T, TT, A > const &c) noexcept |
template<typename T , typename TT , typename A > | |
flat_forward_list< T, TT, A >::const_iterator | cend (flat_forward_list< T, TT, A > const &c) noexcept |
template<typename T , typename TT , typename A > | |
flat_forward_list< T, TT, A >::iterator | last (flat_forward_list< T, TT, A > &c) noexcept |
template<typename T , typename TT , typename A > | |
flat_forward_list< T, TT, A >::const_iterator | last (flat_forward_list< T, TT, A > const &c) noexcept |
template<typename T , typename TT , typename A > | |
flat_forward_list< T, TT, A >::const_iterator | clast (flat_forward_list< T, TT, A > const &c) noexcept |
intrusive flat forward list
iffl::flat_forward_list_const_iterator |
const iterator
T | - element type |
TT | - element type traits |
Default initialized to specialization of flat_forward_list_traits for T
iffl::flat_forward_list_iterator |
non-const iterator
T | - element type |
TT | - element type traits |
Default initialized to specialization of flat_forward_list_traits for T
iffl::pmr_flat_forward_list |
Use this typedef if you want to use container with polymorphic allocator.
T | - element type |
TT | - element type traits |
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
Helper method to cast a pointer to a char *.
p | - Buffer pointer. |
|
inlinenoexcept |
Helper method to cast a pointer to a void *.
p | - Buffer pointer. |
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
copies length bytes from from_buffer to to_buffer. source and destination buffers cannot overlap
to_buffer | - Destination buffer. Must be at least length bytes long |
from_buffer | - Source buffer. Must be at least length bytes long |
length | - number of bytes to copy |
|
inlinenoexcept |
sets "length" consecutive bytes of "to_buffer" to 0.
begin | - Destination buffer. |
end | - number of bytes to assign 0 to |
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
sets "length" consecutive bytes of "to_buffer" to "value".
buffer | - Destination buffer. |
value | - value we are assigning |
length | - number of bytes to assign value to |
|
inlinenoexcept |
Forward declaration.
Validates that buffer contains valid flat forward list and returns a pointer to the last element.
T | - element type |
TT | - element type traits. Defaulted to algorithms expects following methods
|
F | - functor used to validate element by default uses default_validate_element_fn<T, TT> |
first | - start of buffer we are validating |
end | - first byte pass the buffer we are validation buffer size == end - first |
validate_element_fn | - a functor that is used to validate element. For instance if element contains offset to variable lengths data, it can check that these data are in bound of the buffer. Default functor calls TT::validate. You can use noop_validate_element_fn if you do not want validate element |
When TT has get_next_offset we will use flat_forward_list_validate_has_next_offset, otherwise we call flat_forward_list_validate_no_next_offset
|
inlinenoexcept |
Forward declaration.
Overload that takes pointers to element types.
|
inlinenoexcept |
Forward declaration.
Overload that takes pointers to element types.
|
inlinenoexcept |
Forward declaration.
Overload that takes unsigned char const pointers.
|
inlinenoexcept |
Forward declaration.
Overload that takes unsigned char pointers.
|
inlinenoexcept |
Forward declaration.
Overload that takes void const pointers.
|
inlinenoexcept |
Forward declaration.
Overload that takes void pointers.
|
inlinenoexcept |
Forward declaration.
flat_forward_list_validate_has_next_offset
T | - element type |
TT | - element type traits. Defaulted to specialization flat_forward_list_traits<T> |
F | - functor used to validate element by default uses default_validate_element_fn<T, TT> |
Validates if buffer contains a valid intrusive flat forward list See comment for flat_forward_list_validate. Users are not expected to use this function directly, instead use flat_forward_list_validate, which will call flat_forward_list_validate_has_next_offset if TT::get_next_offset is defined.
|
inlinenoexcept |
Forward declaration.
flat_forward_list_validate_no_next_offset
T | - element type |
TT | - element type traits. Defaulted to specialization flat_forward_list_traits<T> |
F | - functor used to validate element by default uses default_validate_element_fn<T, TT> |
Validates if buffer contains a valid intrusive flat forward list See comment for flat_forward_list_validate. Users are not expected to use this function directly, instead prefer to use flat_forward_list_validate, which will call flat_forward_list_validate_no_next_offset if TT::get_next_offset is NOT defined. You can call this function directly IFF TT::get_next_offset is defined, but you want to run validation as if it is not defined.
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
c | - container |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inline |
Factory method for scoped_guard.
Creates an instance of guard given input functor. Helper for lambdas where we do not know name of lambda type
G | - type of functor. It is deduced by compiler from parameter type |
g | - forwarding reference for the functor. |
|
inlinenoexcept |
copies length bytes from from_buffer to to_buffer. source and destination buffers can overlap
to_buffer | - Destination buffer. Must be at least length bytes long |
from_buffer | - Source buffer. Must be at least length bytes long |
length | - number of bytes to copy |
|
inline |
Reinterprets pointer to void value as size_t value.
ptr | - pointer that value we want to put in size_t |
|
inlinenoexcept |
Rounds up pointer to specified alignment.
ptr | - pointer to round up |
alignment | - alignment we are rounding up to |
|
inlinenoexcept |
Rounds up pointer to specified alignment.
T | - type that alignment we are aligning to |
ptr | - pointer to round up |
|
inlinenoexcept |
Rounds up pointer to specified alignment.
ptr | - pointer to round up |
alignment | - alignment we are rounding up to |
|
inlinenoexcept |
Rounds up pointer to specified alignment.
T | - type that alignment we are aligning to |
ptr | - pointer to round up |
|
inlinenoexcept |
Rounds up size to specified alignment.
size | - value to round up |
alignment | - alignment we are rounding up to |
|
inlinenoexcept |
Rounds up size to specified alignment.
T | - type that alignment we are aligning to |
size | - value to round up |
|
inline |
Reinterprets size_t value as pointer to void.
size | - value that we want to reinterpret as a pointer |
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
lhs | - one of the containers we are swapping between |
rhs | - other container we are swapping between |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inlinenoexcept |
T | - element type |
TT | - element type traits |
A | - allocator type that should be used for this container |
lhs | - one of the containers we are swapping between |
rhs | - other container we are swapping between |
TT is default initialized to specialization of flat_forward_list_traits for T A is default initialized to std::allocator for T
|
inline |
Silence sensitizers warning about unused result of expression.
T | - type of unused variable |
|
inline |
Restore saved min and max definition.
Silence unused variable warning when both
T | - type of unused variable |
|
inlinenoexcept |
sets "length" consecutive bytes of "to_buffer" to 0.
buffer | - Destination buffer. |
length | - number of bytes to assign 0 to |