picotm
0.8.0
|
Provides non-transactional state and entries for transactional multisets. More...
Data Structures | |
struct | txmultiset_entry |
Represents an entry in a transaction-safe multiset. More... | |
struct | txmultiset_state |
The global state of transaction-safe multiset. More... | |
Macros | |
#define | __TXMULTISET_ENTRY_INITIALIZER(_parent) |
Initializer macro for struct txmultiset_entry . More... | |
#define | TXMULTISET_ENTRY_INITIALIZER |
Initializer macro for struct txmultiset_entry . | |
#define | TXMULTISET_STATE_INITIALIZER(_multiset_state, _key, _compare) |
Initializer macro for struct txmultiset_state . | |
Typedefs | |
typedef const void *(* | txmultiset_key_function) (struct txmultiset_entry *entry) |
Generates a compare key for a multiset entry. More... | |
typedef int(* | txmultiset_compare_function) (const void *lhs, const void *rhs) |
Key-compare function for two multiset-entry keys. More... | |
Functions | |
PICOTM_NOTHROW void | txmultiset_entry_init (struct txmultiset_entry *self) |
Initializes an entry of a transactional multiset. More... | |
PICOTM_NOTHROW void | txmultiset_entry_uninit (struct txmultiset_entry *self) |
Cleans up an entry of a transactional multiset. More... | |
PICOTM_NOTHROW struct txmultiset_entry * | txmultiset_entry_next_tx (const struct txmultiset_entry *self) |
Returns the next multiset entry. More... | |
PICOTM_NOTHROW struct txmultiset_entry * | txmultiset_entry_prev_tx (const struct txmultiset_entry *self) |
Returns the previous multiset entry. More... | |
PICOTM_NOTHROW void | txmultiset_state_init (struct txmultiset_state *self, txmultiset_key_function key, txmultiset_compare_function compare) |
Initializes multiset state. More... | |
PICOTM_NOTHROW void | txmultiset_state_uninit (struct txmultiset_state *self) |
Cleans up multiset state. More... | |
PICOTM_NOTHROW void | txmultiset_state_clear_and_uninit_entries (struct txmultiset_state *self, void(*uninit)(struct txmultiset_entry *, void *), void *data) |
Removes all entries from a multiset state and runs a cleanup function on each. More... | |
#define __TXMULTISET_ENTRY_INITIALIZER | ( | _parent | ) |
typedef int(* txmultiset_compare_function) (const void *lhs, const void *rhs) |
lhs | The left-hand-side key. |
rhs | The right-hand-side key. |
typedef const void*(* txmultiset_key_function) (struct txmultiset_entry *entry) |
The | multiset entry. |
PICOTM_NOTHROW void txmultiset_entry_init | ( | struct txmultiset_entry * | self | ) |
self | The multiset entry to initialize. |
PICOTM_NOTHROW struct txmultiset_entry* txmultiset_entry_next_tx | ( | const struct txmultiset_entry * | self | ) |
self | The current multiset entry. |
PICOTM_NOTHROW struct txmultiset_entry* txmultiset_entry_prev_tx | ( | const struct txmultiset_entry * | self | ) |
self | The current multiset entry. |
PICOTM_NOTHROW void txmultiset_entry_uninit | ( | struct txmultiset_entry * | self | ) |
self | The multiset entry to clean up. |
PICOTM_NOTHROW void txmultiset_state_clear_and_uninit_entries | ( | struct txmultiset_state * | self, |
void(*)(struct txmultiset_entry *, void *) | uninit, | ||
void * | data | ||
) |
self | The multiset state to clear. |
uninit | The multiset-entry clean-up function. |
data | The clean-up function's data parameter. |
PICOTM_NOTHROW void txmultiset_state_init | ( | struct txmultiset_state * | self, |
txmultiset_key_function | key, | ||
txmultiset_compare_function | compare | ||
) |
self | The multiset state to initialize. |
key | The key generator function for the multiset's entries. |
compare | The key-compare function. |
PICOTM_NOTHROW void txmultiset_state_uninit | ( | struct txmultiset_state * | self | ) |
self | The multiset state to clean up. |