iffl
1.3.4
Implements Intrusive Flat Forward List container
|
traits for an elements that are in the flat forward list More...
#include <iffl_list.h>
traits for an elements that are in the flat forward list
Flat forward list element types are PODs defined in the headers that we often times cannot change, like OS headers, but we need to be able to define methods that would help container operate on them. For instance we need a universal way how to find offset of the next element regardless of how it is calculated for a particular type. Specialization of this class provides a group of functions that help with that. User of the collection is responsible for defining traits for the type he wants to use in the container.
This is the only method required by flat_forward_list_iterator. Returns offset to the next element or 0 if this is the last element.
This method is required for flat_forward_list_validate algorithm Minimum number of bytes to be able to safely query offset to next and safely examine other fields.
This method is required for flat_forward_list_validate algorithm Validates that variable data fits in the buffer
This method is used by flat_forward_list container to update offset to the next element. size can be 0 if this element is last or above zero for any other element.
Specifies alignment requirements for the type. When provided then every newly added element will have proper alignment. Elements that already were in the buffer can be not properly aligned. If this member does not exist then aligned is assumed to be 1 byte
This method is used by flat_forward_list. It calculates size of element, but it should not use next element offset, and instead it should calculate size based on the data this element contains. It is used when we append new element to the container, and need to update offset to the next on the element that used to be last. In that case offset to the next is determined by calling this method. Another example that uses this method is shrink_to_fit.
Examples: flat_forward_list_traits<FLAT_FORWARD_LIST_TEST> @ test\iffl_tests.cpp flat_forward_list_traits<FILE_FULL_EA_INFORMATION> @ test\iffl_es_usecase.cpp flat_forward_list_traits<long_long_array_list_entry> @ test\iffl_c_api_usecase.cpp