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


Go to the source code of this file.
The Private Flat Priority Queue Types and Interface.
The private flat priority queue interface manages the types and macros for the flat priority queue. The implementation attempts to be as efficient as possible by using bottom-up reheap operations to avoid extensive use of comparison callbacks. We also try to avoid swapping elements whenever possible. Instead, we use our temp slot to hold an element and then shift everything down or up tree levels depending on the operations. This saves 2 calls to memcpy per tree level.
Data Structures | |
| struct | CCC_Flat_priority_queue |
Macros | |
| #define | CCC_private_flat_priority_queue_default( private_type_name, private_order, private_comparator...) |
| #define | CCC_private_flat_priority_queue_for( private_type_name, private_order, private_comparator, private_capacity, private_data_pointer) |
| #define | CCC_private_flat_priority_queue_heapify( private_type_name, private_order, private_comparator, private_capacity, private_size, private_data_pointer...) |
| #define | CCC_private_flat_priority_queue_from( private_order, private_comparator, private_allocator, private_optional_capacity, private_compound_literal_array...) |
| #define | CCC_private_flat_priority_queue_with_capacity( private_type_name, private_order, private_comparator, private_allocator, private_capacity) |
| #define | CCC_private_flat_priority_queue_with_storage( private_order, private_comparator, private_compound_literal) |
| #define | CCC_private_flat_priority_queue_emplace( flat_priority_queue, private_allocator_pointer, type_compound_literal...) |
| #define | CCC_private_flat_priority_queue_update_with( flat_priority_queue_pointer, closure_parameter, update_closure_over_closure_parameter...) |
| #define | CCC_private_flat_priority_queue_increase_with( flat_priority_queue_pointer, closure_parameter, increase_closure_over_closure_parameter...) |
| #define | CCC_private_flat_priority_queue_decrease_with( flat_priority_queue_pointer, closure_parameter, decrease_closure_over_closure_parameter...) |
Functions | |
| size_t | CCC_private_flat_priority_queue_bubble_up (struct CCC_Flat_priority_queue const *, void *, size_t) |
| void | CCC_private_flat_priority_queue_heap_order (struct CCC_Flat_priority_queue const *, void *) |
| void * | CCC_private_flat_priority_queue_update_fixup (struct CCC_Flat_priority_queue const *, void *, void *) |
| #define CCC_private_flat_priority_queue_decrease_with | ( | flat_priority_queue_pointer, | |
| closure_parameter, | |||
| decrease_closure_over_closure_parameter... | |||
| ) |
| #define CCC_private_flat_priority_queue_default | ( | private_type_name, | |
| private_order, | |||
| private_comparator... | |||
| ) |
| #define CCC_private_flat_priority_queue_emplace | ( | flat_priority_queue, | |
| private_allocator_pointer, | |||
| type_compound_literal... | |||
| ) |
This macro "returns" a value thanks to clang and gcc statement expressions. See documentation in the flat priority_queueueue header for usage. The ugly details of the macro are hidden here in the impl header.
| #define CCC_private_flat_priority_queue_for | ( | private_type_name, | |
| private_order, | |||
| private_comparator, | |||
| private_capacity, | |||
| private_data_pointer | |||
| ) |
| #define CCC_private_flat_priority_queue_from | ( | private_order, | |
| private_comparator, | |||
| private_allocator, | |||
| private_optional_capacity, | |||
| private_compound_literal_array... | |||
| ) |
| #define CCC_private_flat_priority_queue_heapify | ( | private_type_name, | |
| private_order, | |||
| private_comparator, | |||
| private_capacity, | |||
| private_size, | |||
| private_data_pointer... | |||
| ) |
| #define CCC_private_flat_priority_queue_increase_with | ( | flat_priority_queue_pointer, | |
| closure_parameter, | |||
| increase_closure_over_closure_parameter... | |||
| ) |
| #define CCC_private_flat_priority_queue_update_with | ( | flat_priority_queue_pointer, | |
| closure_parameter, | |||
| update_closure_over_closure_parameter... | |||
| ) |
Only one update fn is needed because there is no advantage to updates if it is known they are min/max increase/decrease etc.
| #define CCC_private_flat_priority_queue_with_capacity | ( | private_type_name, | |
| private_order, | |||
| private_comparator, | |||
| private_allocator, | |||
| private_capacity | |||
| ) |
| #define CCC_private_flat_priority_queue_with_storage | ( | private_order, | |
| private_comparator, | |||
| private_compound_literal | |||
| ) |
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.
| size_t CCC_private_flat_priority_queue_bubble_up | ( | struct CCC_Flat_priority_queue const * | , |
| void * | , | ||
| size_t | |||
| ) |
| void CCC_private_flat_priority_queue_heap_order | ( | struct CCC_Flat_priority_queue const * | , |
| void * | |||
| ) |
| void * CCC_private_flat_priority_queue_update_fixup | ( | struct CCC_Flat_priority_queue const * | , |
| void * | , | ||
| void * | |||
| ) |