|
C Container Collection (CCC)
|
The Private Flat Bitset Types and Interface. More...


Go to the source code of this file.
The Private Flat Bitset Types and Interface.
The bitset is meant for simple contiguous bit operations. Highlights of this implementation include the care given to range based operations in linear time.
Data Structures | |
| struct | CCC_Flat_bitset |
Macros | |
| #define | CCC_private_flat_bitset_block_count(private_bit_capacity) |
| #define | CCC_private_flat_bitset_block_bytes(private_bit_capacity) |
| #define | CCC_private_flat_bitset_default() |
| #define | CCC_private_flat_bitset_non_CCC_private_flat_bitset_default_size( private_cap, ...) __VA_ARGS__ |
| #define | CCC_private_flat_bitset_default_size(private_cap, ...) private_cap |
| #define | CCC_private_flat_bitset_optional_size(private_cap, ...) |
| #define | CCC_private_flat_bitset_for( private_cap, private_count, private_bitblock_pointer) |
| #define | CCC_private_flat_bitset_from( private_allocator, private_start_index, private_count, private_on_char, private_string, ...) |
| #define | CCC_private_flat_bitset_with_capacity( private_allocate, private_cap, ...) |
| #define | CCC_private_flat_bitset_count_check_storage_for( private_count, private_bit_compound_literal, private_optional_storage_specifier...) |
| #define | CCC_private_flat_bitset_storage_for( private_bit_compound_literal, private_optional_storage_specifier...) |
| #define | CCC_private_flat_bitset_with_storage( private_count, private_compound_literal_array, private_optional_storage_specifier...) |
Enumerations | |
| enum | : size_t { CCC_PRIVATE_FLAT_BITSET_BLOCK_BITS = (sizeof(*(struct CCC_Flat_bitset){}.blocks) * CHAR_BIT) } |
Functions | |
| CCC_Result | CCC_private_flat_bitset_reserve (struct CCC_Flat_bitset *, size_t, CCC_Allocator const *) |
| CCC_Tribool | CCC_private_flat_bitset_set (struct CCC_Flat_bitset *, size_t, CCC_Tribool) |
| #define CCC_private_flat_bitset_block_bytes | ( | private_bit_capacity | ) |
Returns the number of bytes needed for the required blocks.
| #define CCC_private_flat_bitset_block_count | ( | private_bit_capacity | ) |
Returns the number of blocks needed to support a given capacity of bits. Assumes the given capacity is greater than 0. Classic div round up.
| #define CCC_private_flat_bitset_count_check_storage_for | ( | private_count, | |
| private_bit_compound_literal, | |||
| private_optional_storage_specifier... | |||
| ) |
Clang is more forgiving with what qualifies as a constant expression for both constructing compound literals and using static asserts. The static asserts are so helpful that it is worth every effort to give them to the user. GCC is not so forgiving.
| #define CCC_private_flat_bitset_default | ( | ) |
| #define CCC_private_flat_bitset_default_size | ( | private_cap, | |
| ... | |||
| ) | private_cap |
| #define CCC_private_flat_bitset_for | ( | private_cap, | |
| private_count, | |||
| private_bitblock_pointer | |||
| ) |
This initializer must be runtime only because the possibility the bitset comes from an uninitialized heap.
| #define CCC_private_flat_bitset_from | ( | private_allocator, | |
| private_start_index, | |||
| private_count, | |||
| private_on_char, | |||
| private_string, | |||
| ... | |||
| ) |
Determine if user wants capacity different than count. Then pass to inline function for bit set construction.
| #define CCC_private_flat_bitset_non_CCC_private_flat_bitset_default_size | ( | private_cap, | |
| ... | |||
| ) | __VA_ARGS__ |
NOLINTNEXTLINE
| #define CCC_private_flat_bitset_optional_size | ( | private_cap, | |
| ... | |||
| ) |
| #define CCC_private_flat_bitset_storage_for | ( | private_bit_compound_literal, | |
| private_optional_storage_specifier... | |||
| ) |
| #define CCC_private_flat_bitset_with_capacity | ( | private_allocate, | |
| private_cap, | |||
| ... | |||
| ) |
.
| #define CCC_private_flat_bitset_with_storage | ( | private_count, | |
| private_compound_literal_array, | |||
| private_optional_storage_specifier... | |||
| ) |
| anonymous enum : size_t |
| CCC_Result CCC_private_flat_bitset_reserve | ( | struct CCC_Flat_bitset * | , |
| size_t | , | ||
| CCC_Allocator const * | |||
| ) |
| CCC_Tribool CCC_private_flat_bitset_set | ( | struct CCC_Flat_bitset * | , |
| size_t | , | ||
| CCC_Tribool | |||
| ) |