MySQL 8.3.0
Source Code Documentation
PFS_notification_registry Struct Reference

PFS_notification_registry A singly linked list of callback registrations. More...

Public Member Functions

 PFS_notification_registry ()
 
 ~PFS_notification_registry ()
 
int add (PFS_notification_node *new_node, bool use_ref_count)
 Add a new registration. More...
 
int disable (int handle)
 Disable a node given its handle. More...
 
PFS_notification_nodeget_first (int event_type)
 Get the first active registration. More...
 
PFS_notification_nodeget_next (PFS_notification_node *current, int event_type)
 Get the next active registration. More...
 

Private Attributes

std::atomic< PFS_notification_node * > m_head
 
std::atomic< std::uint32_t > m_count
 

Static Private Attributes

static const std::uint32_t REFS_MASK = 0x7FFFFFFF
 
static const std::uint32_t FREE_MASK = 0x80000000
 

Detailed Description

PFS_notification_registry A singly linked list of callback registrations.

Callbacks can be unregistered, although the node is disabled and not removed. Plugins must unregister callbacks before unloading. A reference count ensures that the callback functions remain valid until unregister is complete.

Constructor & Destructor Documentation

◆ PFS_notification_registry()

PFS_notification_registry::PFS_notification_registry ( )
inline

◆ ~PFS_notification_registry()

PFS_notification_registry::~PFS_notification_registry ( )
inline

Member Function Documentation

◆ add()

int PFS_notification_registry::add ( PFS_notification_node new_node,
bool  use_ref_count 
)
inline

Add a new registration.

Parameters
new_nodecallback registraion node
use_ref_counttrue if callbacks can be unregistered
Returns
handle of the node

◆ disable()

int PFS_notification_registry::disable ( int  handle)
inline

Disable a node given its handle.

Parameters
handlereturned by add()
Returns
0 if successful, 1 otherwise

◆ get_first()

PFS_notification_node * PFS_notification_registry::get_first ( int  event_type)
inline

Get the first active registration.

Parameters
event_typenotification event
Returns
callback registration or nullptr

◆ get_next()

PFS_notification_node * PFS_notification_registry::get_next ( PFS_notification_node current,
int  event_type 
)
inline

Get the next active registration.

Parameters
currentnode returned from get_first() or get_next()
event_typenotification event
Returns
callback registration or nullptr

Member Data Documentation

◆ FREE_MASK

const std::uint32_t PFS_notification_registry::FREE_MASK = 0x80000000
staticprivate

◆ m_count

std::atomic<std::uint32_t> PFS_notification_registry::m_count
private

◆ m_head

std::atomic<PFS_notification_node *> PFS_notification_registry::m_head
private

◆ REFS_MASK

const std::uint32_t PFS_notification_registry::REFS_MASK = 0x7FFFFFFF
staticprivate

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