MySQL 9.1.0
Source Code Documentation
Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node Class Reference

Node that holds an element (payload) of the MPSC queue. More...

Public Member Functions

 Gcs_mpsc_queue_node ()
 Creates an unlinked and empty node. More...
 
 Gcs_mpsc_queue_node (T *initial_payload)
 Creates an unlinked node with the given payload. More...
 
 Gcs_mpsc_queue_node (Gcs_mpsc_queue_node const &)=delete
 
 Gcs_mpsc_queue_node (Gcs_mpsc_queue_node &&)=delete
 
Gcs_mpsc_queue_nodeoperator= (Gcs_mpsc_queue_node const &)=delete
 
Gcs_mpsc_queue_nodeoperator= (Gcs_mpsc_queue_node &&)=delete
 
Gcs_mpsc_queue_nodeget_next (std::memory_order memory_order)
 Gets the next node in the linked list. More...
 
void set_next (Gcs_mpsc_queue_node *node, std::memory_order memory_order)
 Links a node to this node. More...
 
T * extract_payload ()
 Extracts the payload from this node. More...
 

Private Attributes

std::atomic< Gcs_mpsc_queue_node * > m_next
 The next node in the linked list. More...
 
T * m_payload
 The payload. More...
 

Detailed Description

template<typename T, typename Deleter = std::default_delete<T>>
class Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node

Node that holds an element (payload) of the MPSC queue.

Constructor & Destructor Documentation

◆ Gcs_mpsc_queue_node() [1/4]

template<typename T , typename Deleter = std::default_delete<T>>
Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::Gcs_mpsc_queue_node ( )
inline

Creates an unlinked and empty node.

◆ Gcs_mpsc_queue_node() [2/4]

template<typename T , typename Deleter = std::default_delete<T>>
Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::Gcs_mpsc_queue_node ( T *  initial_payload)
inline

Creates an unlinked node with the given payload.

The node takes ownership of initial_payload.

Parameters
initial_payloadthe payload

◆ Gcs_mpsc_queue_node() [3/4]

template<typename T , typename Deleter = std::default_delete<T>>
Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::Gcs_mpsc_queue_node ( Gcs_mpsc_queue_node const &  )
delete

◆ Gcs_mpsc_queue_node() [4/4]

template<typename T , typename Deleter = std::default_delete<T>>
Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::Gcs_mpsc_queue_node ( Gcs_mpsc_queue_node &&  )
delete

Member Function Documentation

◆ extract_payload()

template<typename T , typename Deleter = std::default_delete<T>>
T * Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::extract_payload ( )
inline

Extracts the payload from this node.

Transfers ownership of the payload to the caller, i.e. after calling this method this node has no payload.

Return values
T*if there is a payload
nullptrotherwise

◆ get_next()

template<typename T , typename Deleter = std::default_delete<T>>
Gcs_mpsc_queue_node * Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::get_next ( std::memory_order  memory_order)
inline

Gets the next node in the linked list.

Parameters
memory_orderthe desired memory ordering semantics for the load
Return values
Gcs_mpsc_queue_node*if there is a linked node
nullptrotherwise

◆ operator=() [1/2]

template<typename T , typename Deleter = std::default_delete<T>>
Gcs_mpsc_queue_node & Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::operator= ( Gcs_mpsc_queue_node &&  )
delete

◆ operator=() [2/2]

template<typename T , typename Deleter = std::default_delete<T>>
Gcs_mpsc_queue_node & Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::operator= ( Gcs_mpsc_queue_node const &  )
delete

◆ set_next()

template<typename T , typename Deleter = std::default_delete<T>>
void Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::set_next ( Gcs_mpsc_queue_node node,
std::memory_order  memory_order 
)
inline

Links a node to this node.

Parameters
nodethe node to link
memory_orderthe desired memory ordering semantics for the store

Member Data Documentation

◆ m_next

template<typename T , typename Deleter = std::default_delete<T>>
std::atomic<Gcs_mpsc_queue_node *> Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::m_next
private

The next node in the linked list.

◆ m_payload

template<typename T , typename Deleter = std::default_delete<T>>
T* Gcs_mpsc_queue< T, Deleter >::Gcs_mpsc_queue_node::m_payload
private

The payload.


The documentation for this class was generated from the following file: