C Container Collection (CCC)
Loading...
Searching...
No Matches
traits.h File Reference

The C Container Collection Traits Interface. More...

#include "private/private_traits.h"
Include dependency graph for traits.h:

Go to the source code of this file.

Detailed Description

The C Container Collection Traits Interface.

Many functionalities across containers are similar. These can be described as traits that each container implements (see Rust Traits for a more pure example of the topic). Only a selection of shared traits across containers are represented here because some containers implement unique functionality that cannot be shared with other containers. These can simplify code greatly at a slightly higher compilation resource cost. There is no runtime cost to using traits.

To shorten names in the interface, define the following preprocessor directive at the top of your file.

#define TRAITS_USING_NAMESPACE_CCC

All traits can then be written without the CCC_ prefix.

Entry Interface

Obtain and operate on container entries for efficient queries when non-trivial control flow is needed.

#define CCC_swap_entry(container_pointer, swap_args...)    CCC_private_swap_entry(container_pointer, swap_args)
 Insert an element and obtain the old value if Occupied.
 
#define CCC_swap_entry_wrap(container_pointer, swap_args...)    CCC_private_swap_entry_wrap(container_pointer, swap_args)
 Insert an element and obtain the old value if Occupied.
 
#define CCC_swap_handle(container_pointer, swap_args...)    CCC_private_swap_handle(container_pointer, swap_args)
 Insert an element and obtain the old value if Occupied.
 
#define CCC_swap_handle_wrap(container_pointer, swap_args...)    CCC_private_swap_handle_wrap(container_pointer, swap_args)
 Insert an element and obtain the old value if Occupied.
 
#define CCC_try_insert(container_pointer, try_insert_args...)    CCC_private_try_insert(container_pointer, try_insert_args)
 Insert an element if the entry is Vacant.
 
#define CCC_try_insert_wrap(container_pointer, try_insert_args...)    CCC_private_try_insert_wrap(container_pointer, try_insert_args)
 Insert an element if the entry is Vacant.
 
#define CCC_insert_or_assign(container_pointer, insert_or_assign_args...)    CCC_private_insert_or_assign(container_pointer, insert_or_assign_args)
 Insert an element or overwrite the Occupied entry.
 
#define CCC_insert_or_assign_wrap(container_pointer, insert_or_assign_args...)    CCC_private_insert_or_assign_wrap(container_pointer, insert_or_assign_args)
 Insert an element or overwrite the Occupied entry.
 
#define CCC_remove_key_value(container_pointer, remove_key_value_args...)    CCC_private_remove_key_value(container_pointer, remove_key_value_args)
 Remove an element and retain access to its value.
 
#define CCC_remove_key_value_wrap(container_pointer, remove_key_value_args...)    CCC_private_remove_key_value_wrap(container_pointer, remove_key_value_args)
 Remove an element and retain access to its value.
 
#define CCC_entry(container_pointer, key_pointer...)    CCC_private_entry(container_pointer, key_pointer)
 Obtain a container specific entry for the Entry Interface.
 
#define CCC_handle(container_pointer, key_pointer...)    CCC_private_handle(container_pointer, key_pointer)
 Obtain a container specific handle for the handle Interface.
 
#define CCC_entry_wrap(container_pointer, key_pointer...)    CCC_private_entry_wrap(container_pointer, key_pointer)
 Obtain a container specific entry for the Entry Interface.
 
#define CCC_handle_wrap(container_pointer, key_pointer...)    CCC_private_handle_wrap(container_pointer, key_pointer)
 Obtain a container specific handle for the handle Interface.
 
#define CCC_and_modify(entry_pointer, mod_fn)    CCC_private_and_modify(entry_pointer, mod_fn)
 Modify an entry if Occupied.
 
#define CCC_and_modify_context(entry_pointer, modify, context_args...)    CCC_private_and_modify_context(entry_pointer, modify, context_args)
 Modify an entry if Occupied.
 
#define CCC_insert_entry(entry_pointer, insert_entry_args...)    CCC_private_insert_entry(entry_pointer, insert_entry_args)
 Insert new element or overwrite old element.
 
#define CCC_insert_handle(array_pointer, insert_array_args...)    CCC_private_insert_handle(array_pointer, insert_array_args)
 Insert new element or overwrite old element.
 
#define CCC_or_insert(entry_pointer, or_insert_args...)    CCC_private_or_insert(entry_pointer, or_insert_args)
 Insert new element if the entry is Vacant.
 
#define CCC_remove_entry(entry_pointer)   CCC_private_remove_entry(entry_pointer)
 Remove the element if the entry is Occupied.
 
#define CCC_remove_entry_wrap(entry_pointer)    CCC_private_remove_entry_wrap(entry_pointer)
 Remove the element if the entry is Occupied.
 
#define CCC_remove_handle(array_pointer)    CCC_private_remove_handle(array_pointer)
 Remove the element if the handle is Occupied.
 
#define CCC_remove_handle_wrap(array_pointer)    CCC_private_remove_handle_wrap(array_pointer)
 Remove the element if the handle is Occupied.
 
#define CCC_unwrap(entry_pointer)   CCC_private_unwrap(entry_pointer)
 Unwrap user type in entry.
 
#define CCC_occupied(entry_pointer)   CCC_private_occupied(entry_pointer)
 Check occupancy of entry.
 
#define CCC_insert_error(entry_pointer)   CCC_private_insert_error(entry_pointer)
 Check last insert status.
 

Membership Interface

Test membership or obtain references to stored user types directly.

#define CCC_get_key_value(container_pointer, key_pointer...)    CCC_private_get_key_value(container_pointer, key_pointer)
 Obtain a reference to the user type stored at the key.
 
#define CCC_contains(container_pointer, key_pointer...)    CCC_private_contains(container_pointer, key_pointer)
 Check for membership of the key.
 

Push Pop Front Back Interface

Push, pop, and view elements in sorted or unsorted containers.

#define CCC_push(container_pointer, push_args...)    CCC_private_push(container_pointer, push_args)
 Push an element into a container.
 
#define CCC_push_back(container_pointer, push_args...)    CCC_private_push_back(container_pointer, push_args)
 Push an element to the back of a container.
 
#define CCC_push_front(container_pointer, push_args...)    CCC_private_push_front(container_pointer, push_args)
 Push an element to the front of a container.
 
#define CCC_pop(container_pointer, pop_args...)    CCC_private_pop(container_pointer, pop_args)
 Pop an element from a container.
 
#define CCC_pop_front(container_pointer)    CCC_private_pop_front(container_pointer)
 Pop an element from the front of a container.
 
#define CCC_pop_back(container_pointer)   CCC_private_pop_back(container_pointer)
 Pop an element from the back of a container.
 
#define CCC_front(container_pointer)   CCC_private_front(container_pointer)
 Obtain a reference the front element of a container.
 
#define CCC_back(container_pointer)   CCC_private_back(container_pointer)
 Obtain a reference the back element of a container.
 
#define CCC_splice(container_pointer, splice_args...)    CCC_private_splice(container_pointer, splice_args)
 Splice an element from one position to another in the same or a different container.
 
#define CCC_splice_range(container_pointer, splice_args...)    CCC_private_splice_range(container_pointer, splice_args)
 Splice a range of elements from one position to another in the same or a different container.
 

Priority Queue Interface

Interface to support generic priority queue operations.

#define CCC_update(container_pointer, update_args...)    CCC_private_update(container_pointer, update_args)
 Update the value of an element known to be in a container.
 
#define CCC_increase(container_pointer, increase_args...)    CCC_private_increase(container_pointer, increase_args)
 Increase the value of an element known to be in a container.
 
#define CCC_decrease(container_pointer, decrease_args...)    CCC_private_decrease(container_pointer, decrease_args)
 Decrease the value of an element known to be in a container.
 
#define CCC_erase(container_pointer, erase_args...)    CCC_private_erase(container_pointer, erase_args)
 Erase an element known to be in a container.
 
#define CCC_extract(container_pointer, extract_args...)    CCC_private_extract(container_pointer, extract_args)
 Extract an element known to be in a container (does not free).
 
#define CCC_extract_range(container_pointer, extract_args...)    CCC_private_extract_range(container_pointer, extract_args)
 Extract elements known to be in a container (does not free).
 

Iterator Interface

Obtain and manage iterators over the container.

#define CCC_begin(container_pointer)   CCC_private_begin(container_pointer)
 Obtain a reference to the start of a container.
 
#define CCC_reverse_begin(container_pointer)    CCC_private_reverse_begin(container_pointer)
 Obtain a reference to the reversed start of a container.
 
#define CCC_next(container_pointer, void_iterator_pointer)    CCC_private_next(container_pointer, void_iterator_pointer)
 Obtain a reference to the next element in the container.
 
#define CCC_reverse_next(container_pointer, void_iterator_pointer)    CCC_private_reverse_next(container_pointer, void_iterator_pointer)
 Obtain a reference to the reverse_next element in the container.
 
#define CCC_end(container_pointer)   CCC_private_end(container_pointer)
 Obtain a reference to the end sentinel of a container.
 
#define CCC_reverse_end(container_pointer)    CCC_private_reverse_end(container_pointer)
 Obtain a reference to the reverse_end sentinel of a container.
 
#define CCC_equal_range(container_pointer, range_args...)    CCC_private_equal_range(container_pointer, range_args)
 Obtain a range of values from a container.
 
#define CCC_equal_range_wrap(container_pointer, range_args...)    CCC_private_equal_range_wrap(container_pointer, range_args)
 Obtain a range of values from a container.
 
#define CCC_equal_range_reverse(container_pointer, range_reverse_args...)    CCC_private_equal_range_reverse(container_pointer, range_reverse_args)
 Obtain a range_reverse of values from a container.
 
#define CCC_equal_range_reverse_wrap(container_pointer, range_reverse_args...)    CCC_private_equal_range_reverse_wrap(container_pointer, range_reverse_args)
 Obtain a range_reverse of values from a container.
 
#define CCC_range_begin(range_pointer)   CCC_private_range_begin(range_pointer)
 Obtain the beginning of the range iterator.
 
#define CCC_range_end(range_pointer)   CCC_private_range_end(range_pointer)
 Obtain the end of the range iterator.
 
#define CCC_range_reverse_begin(range_reverse_pointer)    CCC_private_range_reverse_begin(range_reverse_pointer)
 Obtain the beginning of the reverse range iterator.
 
#define CCC_range_reverse_end(range_reverse_pointer)    CCC_private_range_reverse_end(range_reverse_pointer)
 Obtain the end of the reverse range iterator.
 

Memory Management Interface

Manage underlying buffers for containers.

#define CCC_copy(destination_container_pointer, source_container_pointer, allocate_pointer)
 Copy source containers memory to destination container.
 
#define CCC_reserve(container_pointer, n_to_add, allocate_pointer)    CCC_private_reserve(container_pointer, n_to_add, allocate_pointer)
 Reserve capacity for n_to_add new elements to be inserted.
 
#define CCC_clear(container_pointer, destructor_args...)    CCC_private_clear(container_pointer, destructor_args)
 Clears the container without freeing the underlying buffer.
 
#define CCC_clear_and_free(container_pointer, destructor_and_free_args...)    CCC_private_clear_and_free(container_pointer, destructor_and_free_args)
 Clears the container and frees the underlying buffer.
 
#define CCC_clear_and_free_reserve(container_pointer, destructor_and_free_args...)
 Clears the container previously reserved and frees its underlying buffer. Covers the case of a one-time memory reserved container that does not otherwise have permissions over its own memory to resize or free.
 

State Interface

Obtain the container state.

#define CCC_count(container_pointer)   CCC_private_count(container_pointer)
 Return the count of elements in the container.
 
#define CCC_capacity(container_pointer)   CCC_private_capacity(container_pointer)
 Return the capacity of the container.
 
#define CCC_is_empty(container_pointer)   CCC_private_is_empty(container_pointer)
 Return the size status of a container.
 
#define CCC_validate(container_pointer)   CCC_private_validate(container_pointer)
 Return the invariant statuses of the container.
 

Macro Definition Documentation

◆ CCC_and_modify

#define CCC_and_modify (   entry_pointer,
  mod_fn 
)     CCC_private_and_modify(entry_pointer, mod_fn)

Modify an entry if Occupied.

Parameters
[in]entry_pointera pointer to the container.
[in]mod_fna modification function that does not need context.
Returns
a reference to the modified entry if Occupied or original if Vacant.

See container documentation for specific behavior.

◆ CCC_and_modify_context

#define CCC_and_modify_context (   entry_pointer,
  modify,
  context_args... 
)     CCC_private_and_modify_context(entry_pointer, modify, context_args)

Modify an entry if Occupied.

Parameters
[in]entry_pointera pointer to the container.
[in]modifya modification function.
[in]context_argscontext data for mod_fn.
Returns
a reference to the modified entry if Occupied or original if Vacant.

See container documentation for specific behavior.

◆ CCC_back

#define CCC_back (   container_pointer)    CCC_private_back(container_pointer)

Obtain a reference the back element of a container.

Parameters
[in]container_pointera pointer to the container.
Returns
a reference to a user type.

See container documentation for specific behavior.

◆ CCC_begin

#define CCC_begin (   container_pointer)    CCC_private_begin(container_pointer)

Obtain a reference to the start of a container.

Parameters
[in]container_pointera pointer to the container.
Returns
a reference to the user type stored at the start.

See container documentation for specific behavior.

◆ CCC_capacity

#define CCC_capacity (   container_pointer)    CCC_private_capacity(container_pointer)

Return the capacity of the container.

Parameters
[in]container_pointera pointer to the container.
Returns
the capacity or an argument error is set if container_pointer is NULL.

See container documentation for specific behavior.

◆ CCC_clear

#define CCC_clear (   container_pointer,
  destructor_args... 
)     CCC_private_clear(container_pointer, destructor_args)

Clears the container without freeing the underlying buffer.

Parameters
[in]container_pointera pointer to the container.
[in]destructor_argsoptional function to be called on each element.
Returns
the result of the operation.

See container documentation for specific behavior.

◆ CCC_clear_and_free

#define CCC_clear_and_free (   container_pointer,
  destructor_and_free_args... 
)     CCC_private_clear_and_free(container_pointer, destructor_and_free_args)

Clears the container and frees the underlying buffer.

Parameters
[in]container_pointera pointer to the container.
[in]destructor_and_free_argsoptional function to be called on each element.
Returns
the result of the operation.

See container documentation for specific behavior.

◆ CCC_clear_and_free_reserve

#define CCC_clear_and_free_reserve (   container_pointer,
  destructor_and_free_args... 
)
Value:
CCC_private_clear_and_free_reserve(container_pointer, \
destructor_and_free_args)

Clears the container previously reserved and frees its underlying buffer. Covers the case of a one-time memory reserved container that does not otherwise have permissions over its own memory to resize or free.

Parameters
[in]container_pointera pointer to the container.
[in]destructor_and_free_argsoptional destructor function to be called on each element and the required allocation function to free memory.
Returns
the result of the operation.

See container documentation for specific behavior.

◆ CCC_contains

#define CCC_contains (   container_pointer,
  key_pointer... 
)     CCC_private_contains(container_pointer, key_pointer)

Check for membership of the key.

Parameters
[in]container_pointera pointer to the container.
[in]key_pointera pointer to the search key.
Returns
true if present false if absent.

See container documentation for specific behavior.

◆ CCC_copy

#define CCC_copy (   destination_container_pointer,
  source_container_pointer,
  allocate_pointer 
)
Value:
CCC_private_copy(destination_container_pointer, source_container_pointer, \
allocate_pointer)

Copy source containers memory to destination container.

Parameters
[in]destination_container_pointera pointer to the destination container.
[in]source_container_pointera pointer to the source container.
[in]allocate_pointerthe allocation function to use for resizing if needed.
Returns
the result of the operation.

See container documentation for specific behavior.

◆ CCC_count

#define CCC_count (   container_pointer)    CCC_private_count(container_pointer)

Return the count of elements in the container.

Parameters
[in]container_pointera pointer to the container.
Returns
the size or an argument error is set if container_pointer is NULL.

See container documentation for specific behavior.

◆ CCC_decrease

#define CCC_decrease (   container_pointer,
  decrease_args... 
)     CCC_private_decrease(container_pointer, decrease_args)

Decrease the value of an element known to be in a container.

Parameters
[in]container_pointera pointer to the container.
decrease_argsdepend on the container.

See container documentation for specific behavior.

◆ CCC_end

#define CCC_end (   container_pointer)    CCC_private_end(container_pointer)

Obtain a reference to the end sentinel of a container.

Parameters
[in]container_pointera pointer to the container.
Returns
a reference to the end sentinel.

See container documentation for specific behavior.

◆ CCC_entry

#define CCC_entry (   container_pointer,
  key_pointer... 
)     CCC_private_entry(container_pointer, key_pointer)

Obtain a container specific entry for the Entry Interface.

Parameters
[in]container_pointera pointer to the container.
[in]key_pointera pointer to the search key.
Returns
a container specific entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_entry_wrap

#define CCC_entry_wrap (   container_pointer,
  key_pointer... 
)     CCC_private_entry_wrap(container_pointer, key_pointer)

Obtain a container specific entry for the Entry Interface.

Parameters
[in]container_pointera pointer to the container.
[in]key_pointera pointer to the search key.
Returns
a container specific entry reference depending on container specific context.

See container documentation for specific behavior.

◆ CCC_equal_range

#define CCC_equal_range (   container_pointer,
  range_args... 
)     CCC_private_equal_range(container_pointer, range_args)

Obtain a range of values from a container.

Parameters
[in]container_pointera pointer to the container.
range_argsare container specific.
Returns
the range.

See container documentation for specific behavior.

◆ CCC_equal_range_reverse

#define CCC_equal_range_reverse (   container_pointer,
  range_reverse_args... 
)     CCC_private_equal_range_reverse(container_pointer, range_reverse_args)

Obtain a range_reverse of values from a container.

Parameters
[in]container_pointera pointer to the container.
range_reverse_argsare container specific.
Returns
the range_reverse.

See container documentation for specific behavior.

◆ CCC_equal_range_reverse_wrap

#define CCC_equal_range_reverse_wrap (   container_pointer,
  range_reverse_args... 
)     CCC_private_equal_range_reverse_wrap(container_pointer, range_reverse_args)

Obtain a range_reverse of values from a container.

Parameters
[in]container_pointera pointer to the container.
range_reverse_argsare container specific.
Returns
a reference to the range_reverse.

See container documentation for specific behavior.

◆ CCC_equal_range_wrap

#define CCC_equal_range_wrap (   container_pointer,
  range_args... 
)     CCC_private_equal_range_wrap(container_pointer, range_args)

Obtain a range of values from a container.

Parameters
[in]container_pointera pointer to the container.
range_argsare container specific.
Returns
a reference to the range.

See container documentation for specific behavior.

◆ CCC_erase

#define CCC_erase (   container_pointer,
  erase_args... 
)     CCC_private_erase(container_pointer, erase_args)

Erase an element known to be in a container.

Parameters
[in]container_pointera pointer to the container.
erase_argsdepend on the container.

See container documentation for specific behavior.

◆ CCC_extract

#define CCC_extract (   container_pointer,
  extract_args... 
)     CCC_private_extract(container_pointer, extract_args)

Extract an element known to be in a container (does not free).

Parameters
[in]container_pointera pointer to the container.
extract_argsdepend on the container.

See container documentation for specific behavior.

◆ CCC_extract_range

#define CCC_extract_range (   container_pointer,
  extract_args... 
)     CCC_private_extract_range(container_pointer, extract_args)

Extract elements known to be in a container (does not free).

Parameters
[in]container_pointera pointer to the container.
extract_argsdepend on the container.

See container documentation for specific behavior.

◆ CCC_front

#define CCC_front (   container_pointer)    CCC_private_front(container_pointer)

Obtain a reference the front element of a container.

Parameters
[in]container_pointera pointer to the container.
Returns
a reference to a user type.

See container documentation for specific behavior.

◆ CCC_get_key_value

#define CCC_get_key_value (   container_pointer,
  key_pointer... 
)     CCC_private_get_key_value(container_pointer, key_pointer)

Obtain a reference to the user type stored at the key.

Parameters
[in]container_pointera pointer to the container.
[in]key_pointera pointer to the search key.
Returns
a reference to the stored user type or NULL of absent.

See container documentation for specific behavior.

◆ CCC_handle

#define CCC_handle (   container_pointer,
  key_pointer... 
)     CCC_private_handle(container_pointer, key_pointer)

Obtain a container specific handle for the handle Interface.

Parameters
[in]container_pointera pointer to the container.
[in]key_pointera pointer to the search key.
Returns
a container specific handle depending on container specific context.

See container documentation for specific behavior.

◆ CCC_handle_wrap

#define CCC_handle_wrap (   container_pointer,
  key_pointer... 
)     CCC_private_handle_wrap(container_pointer, key_pointer)

Obtain a container specific handle for the handle Interface.

Parameters
[in]container_pointera pointer to the container.
[in]key_pointera pointer to the search key.
Returns
a container specific handle reference depending on container specific context.

See container documentation for specific behavior.

◆ CCC_increase

#define CCC_increase (   container_pointer,
  increase_args... 
)     CCC_private_increase(container_pointer, increase_args)

Increase the value of an element known to be in a container.

Parameters
[in]container_pointera pointer to the container.
increase_argsdepend on the container.

See container documentation for specific behavior.

◆ CCC_insert_entry

#define CCC_insert_entry (   entry_pointer,
  insert_entry_args... 
)     CCC_private_insert_entry(entry_pointer, insert_entry_args)

Insert new element or overwrite old element.

Parameters
[in]entry_pointera pointer to the container.
insert_entry_argsargs depend on container.
Returns
an reference to the inserted element.

See container documentation for specific behavior.

◆ CCC_insert_error

#define CCC_insert_error (   entry_pointer)    CCC_private_insert_error(entry_pointer)

Check last insert status.

Parameters
[in]entry_pointera pointer to the container.
Returns
true if an insert error occurred false if not.

See container documentation for specific behavior.

◆ CCC_insert_handle

#define CCC_insert_handle (   array_pointer,
  insert_array_args... 
)     CCC_private_insert_handle(array_pointer, insert_array_args)

Insert new element or overwrite old element.

Parameters
[in]array_pointera pointer to the container.
insert_array_argsargs depend on container.
Returns
an reference to the inserted element.

See container documentation for specific behavior.

◆ CCC_insert_or_assign

#define CCC_insert_or_assign (   container_pointer,
  insert_or_assign_args... 
)     CCC_private_insert_or_assign(container_pointer, insert_or_assign_args)

Insert an element or overwrite the Occupied entry.

Parameters
[in]container_pointera pointer to the container.
insert_or_assign_argsargs depend on container.
Returns
an entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_insert_or_assign_wrap

#define CCC_insert_or_assign_wrap (   container_pointer,
  insert_or_assign_args... 
)     CCC_private_insert_or_assign_wrap(container_pointer, insert_or_assign_args)

Insert an element or overwrite the Occupied entry.

Parameters
[in]container_pointera pointer to the container.
insert_or_assign_argsargs depend on container.
Returns
an entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_is_empty

#define CCC_is_empty (   container_pointer)    CCC_private_is_empty(container_pointer)

Return the size status of a container.

Parameters
[in]container_pointera pointer to the container.
Returns
true if empty or NULL false if not.

See container documentation for specific behavior.

◆ CCC_next

#define CCC_next (   container_pointer,
  void_iterator_pointer 
)     CCC_private_next(container_pointer, void_iterator_pointer)

Obtain a reference to the next element in the container.

Parameters
[in]container_pointera pointer to the container.
[in]void_iterator_pointerthe user type returned from the last iteration.
Returns
a reference to the user type stored next.

See container documentation for specific behavior.

◆ CCC_occupied

#define CCC_occupied (   entry_pointer)    CCC_private_occupied(entry_pointer)

Check occupancy of entry.

Parameters
[in]entry_pointera pointer to the container.
Returns
true if Occupied, false if Vacant.

See container documentation for specific behavior.

◆ CCC_or_insert

#define CCC_or_insert (   entry_pointer,
  or_insert_args... 
)     CCC_private_or_insert(entry_pointer, or_insert_args)

Insert new element if the entry is Vacant.

Parameters
[in]entry_pointera pointer to the container.
or_insert_argsargs depend on container.
Returns
an reference to the old element or new element if entry was Vacant.

See container documentation for specific behavior.

◆ CCC_pop

#define CCC_pop (   container_pointer,
  pop_args... 
)     CCC_private_pop(container_pointer, pop_args)

Pop an element from a container.

Parameters
[in]container_pointera pointer to the container.
[in]pop_argsany supplementary args a container may have for the pop.
Returns
a result of the pop operation.

See container documentation for specific behavior.

◆ CCC_pop_back

#define CCC_pop_back (   container_pointer)    CCC_private_pop_back(container_pointer)

Pop an element from the back of a container.

Parameters
[in]container_pointera pointer to the container.
Returns
a result of the pop operation.

See container documentation for specific behavior.

◆ CCC_pop_front

#define CCC_pop_front (   container_pointer)     CCC_private_pop_front(container_pointer)

Pop an element from the front of a container.

Parameters
[in]container_pointera pointer to the container.
Returns
a result of the pop operation.

See container documentation for specific behavior.

◆ CCC_push

#define CCC_push (   container_pointer,
  push_args... 
)     CCC_private_push(container_pointer, push_args)

Push an element into a container.

Parameters
[in]container_pointera pointer to the container.
push_argsdepend on container.
Returns
a reference to the pushed element.

See container documentation for specific behavior.

◆ CCC_push_back

#define CCC_push_back (   container_pointer,
  push_args... 
)     CCC_private_push_back(container_pointer, push_args)

Push an element to the back of a container.

Parameters
[in]container_pointera pointer to the container.
push_argsdepend on container.
Returns
a reference to the pushed element.

See container documentation for specific behavior.

◆ CCC_push_front

#define CCC_push_front (   container_pointer,
  push_args... 
)     CCC_private_push_front(container_pointer, push_args)

Push an element to the front of a container.

Parameters
[in]container_pointera pointer to the container.
push_argsdepend on container.
Returns
a reference to the pushed element.

See container documentation for specific behavior.

◆ CCC_range_begin

#define CCC_range_begin (   range_pointer)    CCC_private_range_begin(range_pointer)

Obtain the beginning of the range iterator.

Parameters
[in]range_pointera pointer to the type of range.
Returns
the iterator representing the beginning. May be equal to end.

◆ CCC_range_end

#define CCC_range_end (   range_pointer)    CCC_private_range_end(range_pointer)

Obtain the end of the range iterator.

Parameters
[in]range_pointera pointer to the type of range.
Returns
the iterator representing the end.
Warning
Do not access the end. It is an exclusive end.

◆ CCC_range_reverse_begin

#define CCC_range_reverse_begin (   range_reverse_pointer)     CCC_private_range_reverse_begin(range_reverse_pointer)

Obtain the beginning of the reverse range iterator.

Parameters
[in]range_reverse_pointera pointer to the type of reverse range.
Returns
the iterator representing the reverse beginning. May be equal to reverse end.

◆ CCC_range_reverse_end

#define CCC_range_reverse_end (   range_reverse_pointer)     CCC_private_range_reverse_end(range_reverse_pointer)

Obtain the end of the reverse range iterator.

Parameters
[in]range_reverse_pointera pointer to the type of reverse range.
Returns
the iterator representing the reverse end.
Warning
Do not access the end. It is an exclusive reverse end.

◆ CCC_remove_entry

#define CCC_remove_entry (   entry_pointer)    CCC_private_remove_entry(entry_pointer)

Remove the element if the entry is Occupied.

Parameters
[in]entry_pointera pointer to the container.
Returns
an entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_remove_entry_wrap

#define CCC_remove_entry_wrap (   entry_pointer)     CCC_private_remove_entry_wrap(entry_pointer)

Remove the element if the entry is Occupied.

Parameters
[in]entry_pointera pointer to the container.
Returns
an entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_remove_handle

#define CCC_remove_handle (   array_pointer)     CCC_private_remove_handle(array_pointer)

Remove the element if the handle is Occupied.

Parameters
[in]array_pointera pointer to the container.
Returns
an handle depending on container specific context.

See container documentation for specific behavior.

◆ CCC_remove_handle_wrap

#define CCC_remove_handle_wrap (   array_pointer)     CCC_private_remove_handle_wrap(array_pointer)

Remove the element if the handle is Occupied.

Parameters
[in]array_pointera pointer to the container.
Returns
an handle depending on container specific context.

See container documentation for specific behavior.

◆ CCC_remove_key_value

#define CCC_remove_key_value (   container_pointer,
  remove_key_value_args... 
)     CCC_private_remove_key_value(container_pointer, remove_key_value_args)

Remove an element and retain access to its value.

Parameters
[in]container_pointera pointer to the container.
remove_argsargs depend on container.
Returns
an entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_remove_key_value_wrap

#define CCC_remove_key_value_wrap (   container_pointer,
  remove_key_value_args... 
)     CCC_private_remove_key_value_wrap(container_pointer, remove_key_value_args)

Remove an element and retain access to its value.

Parameters
[in]container_pointera pointer to the container.
remove_argsargs depend on container.
Returns
an entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_reserve

#define CCC_reserve (   container_pointer,
  n_to_add,
  allocate_pointer 
)     CCC_private_reserve(container_pointer, n_to_add, allocate_pointer)

Reserve capacity for n_to_add new elements to be inserted.

Parameters
[in]container_pointera pointer to the container.
[in]n_to_addthe number of elements to add to the container.
[in]allocate_pointerthe allocation function to use for resizing if needed.
Returns
the result of the operation.

See container documentation for specific behavior.

◆ CCC_reverse_begin

#define CCC_reverse_begin (   container_pointer)     CCC_private_reverse_begin(container_pointer)

Obtain a reference to the reversed start of a container.

Parameters
[in]container_pointera pointer to the container.
Returns
a reference to the user type stored at the reversed start.

See container documentation for specific behavior.

◆ CCC_reverse_end

#define CCC_reverse_end (   container_pointer)     CCC_private_reverse_end(container_pointer)

Obtain a reference to the reverse_end sentinel of a container.

Parameters
[in]container_pointera pointer to the container.
Returns
a reference to the reverse_end sentinel.

See container documentation for specific behavior.

◆ CCC_reverse_next

#define CCC_reverse_next (   container_pointer,
  void_iterator_pointer 
)     CCC_private_reverse_next(container_pointer, void_iterator_pointer)

Obtain a reference to the reverse_next element in the container.

Parameters
[in]container_pointera pointer to the container.
[in]void_iterator_pointerthe user type returned from the last iteration.
Returns
a reference to the user type stored reverse_next.

See container documentation for specific behavior.

◆ CCC_splice

#define CCC_splice (   container_pointer,
  splice_args... 
)     CCC_private_splice(container_pointer, splice_args)

Splice an element from one position to another in the same or a different container.

Parameters
[in]container_pointera pointer to the container.
splice_argsare container specific.
Returns
the result of the splice.

See container documentation for specific behavior.

◆ CCC_splice_range

#define CCC_splice_range (   container_pointer,
  splice_args... 
)     CCC_private_splice_range(container_pointer, splice_args)

Splice a range of elements from one position to another in the same or a different container.

Parameters
[in]container_pointera pointer to the container.
splice_argsare container specific.
Returns
the result of the splice.

See container documentation for specific behavior.

◆ CCC_swap_entry

#define CCC_swap_entry (   container_pointer,
  swap_args... 
)     CCC_private_swap_entry(container_pointer, swap_args)

Insert an element and obtain the old value if Occupied.

Parameters
[in]container_pointera pointer to the container.
swap_argsargs depend on container.
Returns
an entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_swap_entry_wrap

#define CCC_swap_entry_wrap (   container_pointer,
  swap_args... 
)     CCC_private_swap_entry_wrap(container_pointer, swap_args)

Insert an element and obtain the old value if Occupied.

Parameters
[in]container_pointera pointer to the container.
swap_argsargs depend on container.
Returns
an entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_swap_handle

#define CCC_swap_handle (   container_pointer,
  swap_args... 
)     CCC_private_swap_handle(container_pointer, swap_args)

Insert an element and obtain the old value if Occupied.

Parameters
[in]container_pointera pointer to the container.
swap_argsargs depend on container.
Returns
a handle depending on container specific context.

See container documentation for specific behavior.

◆ CCC_swap_handle_wrap

#define CCC_swap_handle_wrap (   container_pointer,
  swap_args... 
)     CCC_private_swap_handle_wrap(container_pointer, swap_args)

Insert an element and obtain the old value if Occupied.

Parameters
[in]container_pointera pointer to the container.
swap_argsargs depend on container.
Returns
a handle depending on container specific context.

See container documentation for specific behavior.

◆ CCC_try_insert

#define CCC_try_insert (   container_pointer,
  try_insert_args... 
)     CCC_private_try_insert(container_pointer, try_insert_args)

Insert an element if the entry is Vacant.

Parameters
[in]container_pointera pointer to the container.
try_insert_argsargs depend on container.
Returns
an entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_try_insert_wrap

#define CCC_try_insert_wrap (   container_pointer,
  try_insert_args... 
)     CCC_private_try_insert_wrap(container_pointer, try_insert_args)

Insert an element if the entry is Vacant.

Parameters
[in]container_pointera pointer to the container.
try_insert_argsargs depend on container.
Returns
an entry depending on container specific context.

See container documentation for specific behavior.

◆ CCC_unwrap

#define CCC_unwrap (   entry_pointer)    CCC_private_unwrap(entry_pointer)

Unwrap user type in entry.

Parameters
[in]entry_pointera pointer to the container.
Returns
a valid reference if Occupied or NULL if vacant.

See container documentation for specific behavior.

◆ CCC_update

#define CCC_update (   container_pointer,
  update_args... 
)     CCC_private_update(container_pointer, update_args)

Update the value of an element known to be in a container.

Parameters
[in]container_pointera pointer to the container.
update_argsdepend on the container.

See container documentation for specific behavior.

◆ CCC_validate

#define CCC_validate (   container_pointer)    CCC_private_validate(container_pointer)

Return the invariant statuses of the container.

Parameters
[in]container_pointera pointer to the container.
Returns
true if all invariants hold, false if not.

See container documentation for specific behavior.