|
| void | im_init (struct interval_map *self, struct interval_map_vtabk *vtabk, struct interval_map_vtabv *vtabv) |
| | IMPLEMENTATIONS.
|
| |
| void | im_drop (struct interval_map *_self_) |
| |
| void | im_clone (struct interval_map *orig, struct interval_map *clone) |
| |
| enum cvx_flags | im_flag (struct interval_map *_self_) |
| |
| size_t | im_count (struct interval_map *_self_) |
| |
| _Bool | im_empty (struct interval_map *_self_) |
| |
| void | im_add (struct interval_map *_self_, TKey _lo_, TKey _hi_, TVal _val_) |
| |
| void | im_remove (struct interval_map *_self_, TKey _lo_, TKey _hi_) |
| |
| TVal | im_get (struct interval_map *_self_, TKey _key_) |
| |
| _Bool | im_contains_key (struct interval_map *_self_, TKey _key_) |
| |
| _Bool | im_contains_interval (struct interval_map *_self_, TKey _lo_, TKey _hi_) |
| |
| _Bool | im_overlaps (struct interval_map *_self_, TKey _lo_, TKey _hi_) |
| |
| struct interval_map_iter | im_iter_init_start (struct interval_map *_target_) |
| | ITERATOR.
|
| |
| struct interval_map_iter | im_iter_init_end (struct interval_map *_target_) |
| |
| struct interval_map_iter * | im_iter_start (struct interval_map *_target_) |
| |
| struct interval_map_iter * | im_iter_end (struct interval_map *_target_) |
| |
| void | im_iter_drop (struct interval_map_iter *_iter_) |
| |
| _Bool | im_iter_at_start (struct interval_map_iter *_iter_) |
| |
| _Bool | im_iter_at_end (struct interval_map_iter *_iter_) |
| |
| size_t | im_iter_count (struct interval_map_iter *_iter_) |
| |
| void | im_iter_to_start (struct interval_map_iter *_iter_) |
| |
| void | im_iter_to_end (struct interval_map_iter *_iter_) |
| |
| void | im_iter_next (struct interval_map_iter *_iter_) |
| |
| void | im_iter_prev (struct interval_map_iter *_iter_) |
| |
| void | im_iter_forward (struct interval_map_iter *_iter_, size_t _steps_) |
| |
| void | im_iter_backward (struct interval_map_iter *_iter_, size_t _steps_) |
| |
| struct interval_map_entry | im_iter_entry (struct interval_map_iter *_iter_) |
| |
| TKey | im_iter_value_lo (struct interval_map_iter *_iter_) |
| |
| TKey | im_iter_value_hi (struct interval_map_iter *_iter_) |
| |
| TVal | im_iter_value_val (struct interval_map_iter *_iter_) |
| |
| size_t | im_iter_index (struct interval_map_iter *_iter_) |
| |
| _Bool | im__assert_capacity (struct interval_map *_self_) |
| | PRIVATE FUNCTIONS.
|
| |
| size_t | im__lower_bound_k (struct interval_map *_self_, TKey _lo_) |
| |
| void | im__proxy_clone (cvx_container *_orig_, cvx_container *_clone_) |
| | PROXIES.
|
| |
| void | im__proxy_drop (cvx_container *_col_) |
| |
| size_t | im__proxy_count (cvx_container *_col_) |
| |
| _Bool | im__proxy_empty (cvx_container *_col_) |
| |
| void | im__proxy_add (cvx_container *_col_, TKey _lo_, TKey _hi_, TVal _val_) |
| |
| void | im__proxy_remove (cvx_container *_col_, TKey _lo_, TKey _hi_) |
| |
| TVal | im__proxy_get (cvx_container *_col_, TKey _key_) |
| |
| _Bool | im__proxy_contains_key (cvx_container *_col_, TKey _key_) |
| |
| _Bool | im__proxy_contains_interval (cvx_container *_col_, TKey _lo_, TKey _hi_) |
| |
| _Bool | im__proxy_overlaps (cvx_container *_col_, TKey _lo_, TKey _hi_) |
| |
| cvx_container * | im__proxy_iter_start (cvx_container *_col_) |
| |
| cvx_container * | im__proxy_iter_end (cvx_container *_col_) |
| |
| void | im__proxy_iter_drop (cvx_container *_col_) |
| |
| _Bool | im__proxy_iter_at_start (cvx_container *_col_) |
| |
| _Bool | im__proxy_iter_at_end (cvx_container *_col_) |
| |
| size_t | im__proxy_iter_count (cvx_container *_col_) |
| |
| void | im__proxy_iter_to_start (cvx_container *_col_) |
| |
| void | im__proxy_iter_to_end (cvx_container *_col_) |
| |
| void | im__proxy_iter_next (cvx_container *_col_) |
| |
| void | im__proxy_iter_prev (cvx_container *_col_) |
| |
| void | im__proxy_iter_forward (cvx_container *_col_, size_t _steps_) |
| |
| void | im__proxy_iter_backward (cvx_container *_col_, size_t _steps_) |
| |
| struct interval_map_entry | im__proxy_iter_entry (cvx_container *_col_) |
| |
| TKey | im__proxy_iter_value_lo (cvx_container *_col_) |
| |
| TKey | im__proxy_iter_value_hi (cvx_container *_col_) |
| |
| TVal | im__proxy_iter_value_val (cvx_container *_col_) |
| |
| size_t | im__proxy_iter_index (cvx_container *_col_) |
| |
interval_map.h
Status
[x] concept [ ] v1 [ ] tests [ ] refine [ ] stabilize
Interval map with right-open intervals [lo, hi).
Maps each [lo, hi) → V, with no overlapping intervals. On _add, existing intervals that overlap or touch (with the same value, when vtabv->comp is set) the inserted range are merged; partial overlaps with a different value produce left/right residual intervals. On _remove, intervals overlapping the erased range are split if necessary.
vtabk->comp is required. vtabk->clone / vtabk->drop apply to K boundary values. vtabv->comp, if set, enables joining of adjacent equal-value intervals. vtabv->clone / vtabv->drop apply to V values.
iter_entry returns struct ENTRY {K lo; K hi; V val;}. To cast to a generic iterator interface, declare it with V = struct CVX(SNAME,_entry) BEFORE including this header.
Status and error flags for the CVX library.
Error Handling
| Enumerator |
|---|
| CVX_FLAG_OK | No errors.
|
| CVX_FLAG_VTAB | Required vtab function was not provided.
|
| CVX_FLAG_WRONG_TAG | Tags are checked so you don't pass the wrong struct to a function.
|
| CVX_FLAG_ALLOC | Allocation failed.
|
| CVX_FLAG_EMPTY | Operation can not proceed because the container is empty.
|
| CVX_FLAG_FULL | When a container that doesn't resize is full.
|
| CVX_FLAG_RANGE | Index out of range.
|
| CVX_FLAG_NOT_FOUND | Key or value not found.
|
| CVX_FLAG_INVALID | Invalid argument or operation.
|
| CVX_FLAG_DUPLICATE | Duplicate key or value.
|
| CVX_FLAG_ERROR | Generic error, or unknown error.
|