Data Fields | |
struct bucket | buckets [0] |
ao2_callback_fn * | cmp_fn |
int | elements |
ao2_hash_fn * | hash_fn |
int | n_buckets |
int | version |
A container; stores the hash and callback functions, information on the size, the hash bucket heads, and a version number, starting at 0 (for a newly created, empty container) and incremented every time an object is inserted or deleted. The assumption is that an object is never moved in a container, but removed and readded with the new number. The version number is especially useful when implementing iterators. In fact, we can associate a unique, monotonically increasing number to each object, which means that, within an iterator, we can store the version number of the current object, and easily look for the next one, which is the next one in the list with a higher number. Since all objects have a version >0, we can use 0 as a marker for 'we need the first object in the bucket'.
variable size
Definition at line 447 of file astobj2.c.
Referenced by __ao2_callback(), __ao2_iterator_next(), container_destruct(), and container_destruct_debug().
Definition at line 440 of file astobj2.c.
Referenced by __ao2_container_alloc(), _ao2_find(), and _ao2_find_debug().
int elements |
Number of elements in the container
Definition at line 443 of file astobj2.c.
Referenced by __ao2_callback(), and ao2_container_count().
Definition at line 439 of file astobj2.c.
Referenced by __ao2_callback(), and __ao2_container_alloc().
int n_buckets |
Definition at line 441 of file astobj2.c.
Referenced by __ao2_callback(), __ao2_container_alloc(), __ao2_iterator_next(), container_destruct(), and container_destruct_debug().
int version |
described above
Definition at line 445 of file astobj2.c.
Referenced by __ao2_callback(), __ao2_container_alloc(), and __ao2_iterator_next().