Functions

Provides transactional lists. More...

#include <picotm/compiler.h>
#include <picotm/config/picotm-txlib-config.h>
#include <stdbool.h>
#include <stddef.h>
#include "picotm-txlist-state.h"

Functions

PICOTM_NOTHROW struct txlist_entrytxlist_back_tx (struct txlist *self)
 Returns the back-end entry of a transactional list without removing it. More...
 
PICOTM_NOTHROW struct txlist_entrytxlist_begin_tx (struct txlist *self)
 Returns the first entry of a transactional list. More...
 
PICOTM_NOTHROW void txlist_clear_tx (struct txlist *self)
 Removes all entries from a transactional list. More...
 
PICOTM_NOTHROW bool txlist_empty_tx (struct txlist *self)
 Tests a transactional list for emptiness. More...
 
PICOTM_NOTHROW struct txlist_entrytxlist_end_tx (struct txlist *self)
 Returns the terminator of a transactional list. More...
 
PICOTM_NOTHROW void txlist_entry_init_tm (struct txlist_entry *self)
 Initializes an entry of a transactional list from within a transaction. More...
 
PICOTM_NOTHROW void txlist_entry_uninit_tm (struct txlist_entry *self)
 Cleans up an entry of a transactional list from within a transaction. More...
 
PICOTM_NOTHROW void txlist_erase_tx (struct txlist *self, struct txlist_entry *entry)
 Removes an entry from a transactional list. More...
 
PICOTM_NOTHROW struct txlist_entrytxlist_front_tx (struct txlist *self)
 Returns the front-end entry of a transactional list without removing it. More...
 
PICOTM_NOTHROW void txlist_insert_tx (struct txlist *self, struct txlist_entry *entry, struct txlist_entry *position)
 Inserts an entry into a transactional list. More...
 
PICOTM_NOTHROW struct txlisttxlist_of_state_tx (struct txlist_state *list_state)
 Creates a transactional list for a list state. More...
 
PICOTM_NOTHROW void txlist_pop_back_tx (struct txlist *self)
 Removes the last entry of a transactional list. More...
 
PICOTM_NOTHROW void txlist_pop_front_tx (struct txlist *self)
 Removes the first entry of a transactional list. More...
 
PICOTM_NOTHROW void txlist_push_back_tx (struct txlist *self, struct txlist_entry *entry)
 Inserts an entry at the end of a transactional list. More...
 
PICOTM_NOTHROW void txlist_push_front_tx (struct txlist *self, struct txlist_entry *entry)
 Inserts an entry at the beginning of a transactional list. More...
 
PICOTM_NOTHROW size_t txlist_size_tx (struct txlist *self)
 Returns the number of entries in a transactional list. More...
 

Function Documentation

◆ txlist_back_tx()

PICOTM_NOTHROW struct txlist_entry* txlist_back_tx ( struct txlist self)
Parameters
selfThe transactional list.
Returns
The front entry.

◆ txlist_begin_tx()

PICOTM_NOTHROW struct txlist_entry* txlist_begin_tx ( struct txlist self)
Parameters
selfThe transactional list.
Returns
The transactional list's first entry.

◆ txlist_clear_tx()

PICOTM_NOTHROW void txlist_clear_tx ( struct txlist self)
Parameters
selfThe transactional list.

◆ txlist_empty_tx()

PICOTM_NOTHROW bool txlist_empty_tx ( struct txlist self)
Parameters
selfThe transactional list.
Returns
True if the list is empty, false otherwise.

◆ txlist_end_tx()

PICOTM_NOTHROW struct txlist_entry* txlist_end_tx ( struct txlist self)
Parameters
selfThe transactional list.
Returns
The transactional list's terminator entry.

◆ txlist_entry_init_tm()

PICOTM_NOTHROW void txlist_entry_init_tm ( struct txlist_entry self)
Parameters
selfThe list entry to initialize.
Attention
This function expects the entry's memory to be owned by the calling transaction. Shared-memory locations have to be read/write privatized first.

◆ txlist_entry_uninit_tm()

PICOTM_NOTHROW void txlist_entry_uninit_tm ( struct txlist_entry self)
Parameters
selfThe list entry to clean up.
Attention
This function expects the entry's memory to be owned by the calling transaction. Shared-memory locations have to be read/write privatized first.

◆ txlist_erase_tx()

PICOTM_NOTHROW void txlist_erase_tx ( struct txlist self,
struct txlist_entry entry 
)
Parameters
selfThe transactional list.
entryThe list entry to remove.

◆ txlist_front_tx()

PICOTM_NOTHROW struct txlist_entry* txlist_front_tx ( struct txlist self)
Parameters
selfThe transactional list.
Returns
The front entry.

◆ txlist_insert_tx()

PICOTM_NOTHROW void txlist_insert_tx ( struct txlist self,
struct txlist_entry entry,
struct txlist_entry position 
)
Parameters
selfThe transactional list.
entryThe list entry to insert.
positionThe list entry before which the new entry is inserted.

◆ txlist_of_state_tx()

PICOTM_NOTHROW struct txlist* txlist_of_state_tx ( struct txlist_state list_state)
Parameters
list_stateThe list state.
Returns
A transactional list for the list state.

◆ txlist_pop_back_tx()

PICOTM_NOTHROW void txlist_pop_back_tx ( struct txlist self)
Parameters
selfThe transactional list.

◆ txlist_pop_front_tx()

PICOTM_NOTHROW void txlist_pop_front_tx ( struct txlist self)
Parameters
selfThe transactional list.

◆ txlist_push_back_tx()

PICOTM_NOTHROW void txlist_push_back_tx ( struct txlist self,
struct txlist_entry entry 
)
Parameters
selfThe transactional list.
entryThe list entry to insert.

◆ txlist_push_front_tx()

PICOTM_NOTHROW void txlist_push_front_tx ( struct txlist self,
struct txlist_entry entry 
)
Parameters
selfThe transactional list.
entryThe list entry to insert.

◆ txlist_size_tx()

PICOTM_NOTHROW size_t txlist_size_tx ( struct txlist self)
Parameters
selfThe transactional list.
Returns
The number of entries in the transactional list.