MySQL 8.0.40
Source Code Documentation
Mysql_thd_store_service_imp Class Referencefinal

#include <mysql_thd_store_imp.h>

Static Public Member Functions

static mysql_service_status_t register_slot (const char *name, free_resource_fn free_fn, mysql_thd_store_slot *slot) noexcept
 Register a slot to store data specific to a component. More...
 
static mysql_service_status_t unregister_slot (mysql_thd_store_slot slot) noexcept
 Unregister a slot. More...
 
static mysql_service_status_t set (MYSQL_THD thd, mysql_thd_store_slot slot, void *object) noexcept
 Adds an opaque pointer to the session object. More...
 
static void * get (MYSQL_THD thd, mysql_thd_store_slot slot) noexcept
 Get handle to an already stored object without removing it. More...
 

Member Function Documentation

◆ get()

void * Mysql_thd_store_service_imp::get ( MYSQL_THD  thd,
mysql_thd_store_slot  slot 
)
staticnoexcept

Get handle to an already stored object without removing it.

Parameters
[in]thdSession handle. If NULL, current session will be used.
[in]slotKey used to identify the object handle
Returns
handle to the object if found, nullptr otherwise

◆ register_slot()

mysql_service_status_t Mysql_thd_store_service_imp::register_slot ( const char *  name,
free_resource_fn  free_fn,
mysql_thd_store_slot slot 
)
staticnoexcept

Register a slot to store data specific to a component.

The free_resource callback is used to free the stored pointer before thd is destroyed

Parameters
[in]nameImplementation name
[in]free_fnCallback to free resource stored in the slot
[out]slotKey used to identify the object handle
Returns
status of registration
Return values
falseSuccess
trueError. This typically means all slots are full

◆ set()

mysql_service_status_t Mysql_thd_store_service_imp::set ( MYSQL_THD  thd,
mysql_thd_store_slot  slot,
void *  object 
)
staticnoexcept

Adds an opaque pointer to the session object.

Parameters
[in]thdSession handle. If NULL, current session will be used.
[in]slotKey used to identify the object handle
[in]objectHandle of the object being stored. If NULL, it will be considered removal.
Returns
Status of the operation
Return values
falseSuccess
trueError

◆ unregister_slot()

mysql_service_status_t Mysql_thd_store_service_imp::unregister_slot ( mysql_thd_store_slot  slot)
staticnoexcept

Unregister a slot.

Parameters
[in,out]slotKey allocated to component
Returns
status of operation
Return values
falseSuccess
trueError

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