MySQL 9.0.0
Source Code Documentation
mysql_registry_no_lock_imp Class Reference

#include <registry_no_lock_imp.h>

Inheritance diagram for mysql_registry_no_lock_imp:
[legend]

Static Public Member Functions

static void deinit ()
 De-initializes registry, other structures. More...
 
static uint64_t get_service_implementation_reference_count (my_h_service interface)
 Gets current reference count for a Service Implementation related to the specified pointer to the interface structure. More...
 
static bool acquire_nolock (const char *service_name, my_h_service *out_service)
 Finds and acquires a Service by name. More...
 
static bool release_nolock (my_h_service service)
 Releases the Service Implementation previously acquired. More...
 
static bool register_service_nolock (const char *service_implementation_name, my_h_service ptr)
 Registers a new Service Implementation. More...
 
static bool unregister_nolock (const char *service_implementation_name)
 Removes previously registered Service Implementation from registry. More...
 
static mysql_service_status_t acquire (const char *service_name, my_h_service *out_service) noexcept
 Finds and acquires a Service by name. More...
 
static mysql_service_status_t acquire_related (const char *service_name, my_h_service service, my_h_service *out_service) noexcept
 Finds a Service by name. More...
 
static mysql_service_status_t release (my_h_service service) noexcept
 Releases the Service Implementation previously acquired. More...
 
static mysql_service_status_t register_service (const char *service_implementation_name, my_h_service ptr) noexcept
 Registers a new Service Implementation. More...
 
static mysql_service_status_t unregister (const char *service_implementation_name) noexcept
 Removes previously registered Service Implementation from registry. More...
 
static mysql_service_status_t set_default (const char *service_implementation_name) noexcept
 Sets new default Service Implementation for corresponding Service name. More...
 

Protected Types

typedef std::map< my_h_service, mysql_service_implementation * > my_interface_mapping
 

Static Protected Attributes

static my_service_registry service_registry
 
static my_interface_mapping interface_mapping
 

Static Private Member Functions

static mysql_service_implementationget_service_implementation_by_interface (my_h_service interface)
 Finds a Service Implementation data structure based on the pointer to interface struct supplied. More...
 

Member Typedef Documentation

◆ my_interface_mapping

Member Function Documentation

◆ acquire()

mysql_service_status_t mysql_registry_no_lock_imp::acquire ( const char *  service_name,
my_h_service out_service 
)
staticnoexcept

Finds and acquires a Service by name.

A name of the Service or the Service Implementation can be specified. In case of the Service name, the default Service Implementation for Service specified will be returned.

This does not take any lock on the registry. It must not be used unless absolutely necessary. Use the mysql_registry_imp version instead.

Parameters
service_nameName of Service or Service Implementation to acquire.
[out]out_servicePointer to Service handle to set acquired Service.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ acquire_nolock()

bool mysql_registry_no_lock_imp::acquire_nolock ( const char *  service_name,
my_h_service out_service 
)
static

Finds and acquires a Service by name.

A name of the Service or the Service Implementation can be specified. In case of the Service name, the default Service Implementation for Service specified will be returned. Assumes caller has at least a read lock on the Registry.

Parameters
service_nameName of Service or Service Implementation to acquire.
[out]out_servicePointer to Service handle to set acquired Service.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ acquire_related()

mysql_service_status_t mysql_registry_no_lock_imp::acquire_related ( const char *  service_name,
my_h_service  service,
my_h_service out_service 
)
staticnoexcept

Finds a Service by name.

If there is a Service Implementation with the same Component part of name as the input Service then the found Service is returned.

This does not take any lock on the registry. It must not be used unless absolutely necessary. Use the mysql_registry_imp version instead.

Parameters
service_nameName of Service or Service Implementation to acquire.
serviceService handle already acquired Service Implementation.
[out]out_servicePointer to Service Implementation handle to set acquired Service Implementation.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ deinit()

void mysql_registry_no_lock_imp::deinit ( )
static

De-initializes registry, other structures.

◆ get_service_implementation_by_interface()

mysql_service_implementation * mysql_registry_no_lock_imp::get_service_implementation_by_interface ( my_h_service  interface)
staticprivate

Finds a Service Implementation data structure based on the pointer to interface struct supplied.

Assumes caller has at least a read lock on the Registry.

Parameters
interfaceA pointer to the interface structure of the Service Implementation to look for.
Returns
A pointer to respective Service Implementation data structure, or NULL if no such interface pointer is registered within the Registry.

◆ get_service_implementation_reference_count()

uint64_t mysql_registry_no_lock_imp::get_service_implementation_reference_count ( my_h_service  interface)
static

Gets current reference count for a Service Implementation related to the specified pointer to the interface structure.

Assumes caller has at least a read lock on the Registry.

Parameters
interfaceA pointer to the interface structure of the Service Implementation to get reference count of.
Returns
A current reference count for specified Service Implementation. Returns 0 in case there is no such interface or it is not referenced.

◆ register_service()

mysql_service_status_t mysql_registry_no_lock_imp::register_service ( const char *  service_implementation_name,
my_h_service  ptr 
)
staticnoexcept

Registers a new Service Implementation.

If it is the first Service Implementation for the specified Service then it is made a default one.

This does not take any lock on the registry. It must not be used unless absolutely necessary. Use the mysql_registry_imp version instead.

Parameters
service_implementation_nameName of the Service Implementation to register.
ptrPointer to the Service Implementation structure.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ register_service_nolock()

bool mysql_registry_no_lock_imp::register_service_nolock ( const char *  service_implementation_name,
my_h_service  ptr 
)
static

Registers a new Service Implementation.

If it is the first Service Implementation for the specified Service then it is made a default one. Assumes caller has a write lock on the Registry.

Parameters
service_implementation_nameName of the Service Implementation to register.
ptrPointer to the Service Implementation structure.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ release()

mysql_service_status_t mysql_registry_no_lock_imp::release ( my_h_service  service)
staticnoexcept

Releases the Service Implementation previously acquired.

After the call to this method the usage of the Service Implementation handle will lead to unpredicted results.

This does not take any lock on the registry. It must not be used unless absolutely necessary. Use the mysql_registry_imp version instead.

Parameters
serviceService Implementation handle of already acquired Service.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ release_nolock()

bool mysql_registry_no_lock_imp::release_nolock ( my_h_service  service)
static

Releases the Service Implementation previously acquired.

After the call to this method the usage of the Service Implementation handle will lead to unpredicted results. Assumes caller has at least a read lock on the Registry.

Parameters
serviceService Implementation handle of already acquired Service.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ set_default()

mysql_service_status_t mysql_registry_no_lock_imp::set_default ( const char *  service_implementation_name)
staticnoexcept

Sets new default Service Implementation for corresponding Service name.

This does not take any lock on the registry. It must not be used unless absolutely necessary. Use the mysql_registry_imp version instead.

Parameters
service_implementation_nameName of the Service Implementation to set as default one.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ unregister()

mysql_service_status_t mysql_registry_no_lock_imp::unregister ( const char *  service_implementation_name)
staticnoexcept

Removes previously registered Service Implementation from registry.

If it is the default one for specified Service then any one still registered is made default. If there is no other, the default entry is removed from the Registry too.

This does not take any lock on the registry. It must not be used unless absolutely necessary. Use the mysql_registry_imp version instead.

Parameters
service_implementation_nameName of the Service Implementation to unregister.
Returns
Status of performed operation
Return values
falsesuccess
trueFailure. May happen when Service is still being referenced.

◆ unregister_nolock()

bool mysql_registry_no_lock_imp::unregister_nolock ( const char *  service_implementation_name)
static

Removes previously registered Service Implementation from registry.

If it is the default one for specified Service then any one still registered is made default. If there is no other, the default entry is removed from the Registry too. Assumes caller has a write lock on the Registry.

Parameters
service_implementation_nameName of the Service Implementation to unregister.
Returns
Status of performed operation
Return values
falsesuccess
trueFailure. May happen when Service is still being referenced.

Member Data Documentation

◆ interface_mapping

mysql_registry_no_lock_imp::my_interface_mapping mysql_registry_no_lock_imp::interface_mapping
staticprotected

◆ service_registry

my_service_registry mysql_registry_no_lock_imp::service_registry
staticprotected

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