24#ifndef MYSQL_SERVER_REGISTRY_H
25#define MYSQL_SERVER_REGISTRY_H
37typedef std::map<const char *, mysql_service_implementation *, c_string_less>
41 typedef std::map<my_h_service, mysql_service_implementation *>
197 (
const char *service_implementation_name,
213 (
const char *service_implementation_name));
225 (
const char *service_implementation_name));
247 (
const char *service_name_pattern,
270 const char **out_name));
301#define OBJECT_ITERATOR my_h_service_iterator
302#define METADATA_ITERATOR my_h_service_metadata_iterator
Locks RW-lock and releases lock on scope exit.
Definition: rwlock_scoped_lock.h:33
Definition: registry_imp.h:40
static void init()
Initializes registry for usage.
Definition: registry.cc:84
static mysql_service_status_t register_service(const char *service_implementation_name, my_h_service ptr) noexcept
Registers a new Service Implementation.
Definition: registry.cc:448
static mysql_rwlock_t LOCK_registry
Definition: registry_imp.h:47
static mysql_service_status_t iterator_get(my_h_service_iterator iterator, const char **out_name) noexcept
Gets name of Service pointed to by iterator.
Definition: registry.cc:589
static mysql_service_status_t iterator_is_valid(my_h_service_iterator iterator) noexcept
Checks if specified iterator is valid, i.e.
Definition: registry.cc:645
static my_interface_mapping interface_mapping
Definition: registry_imp.h:46
std::map< my_h_service, mysql_service_implementation * > my_interface_mapping
Definition: registry_imp.h:42
static mysql_service_status_t acquire(const char *service_name, my_h_service *out_service) noexcept
Finds and acquires a Service by name.
Definition: registry.cc:362
static bool release_nolock(my_h_service service)
Releases the Service Implementation previously acquired.
Definition: registry.cc:205
static mysql_service_status_t set_default(const char *service_implementation_name) noexcept
Sets new default Service Implementation for corresponding Service name.
Definition: registry.cc:486
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 int...
Definition: registry.cc:150
static minimal_chassis::rwlock_scoped_lock lock_registry_for_write()
Locks whole registry for write.
Definition: registry.cc:113
static mysql_service_implementation * get_service_implementation_by_interface(my_h_service interface)
Finds a Service Implementation data structure based on the pointer to interface struct supplied.
Definition: registry.cc:129
static my_service_registry service_registry
Definition: registry_imp.h:45
static bool register_service_nolock(const char *service_implementation_name, my_h_service ptr)
Registers a new Service Implementation.
Definition: registry.cc:234
static void deinit()
De-initializes registry.
Definition: registry.cc:93
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.
Definition: registry.cc:384
static mysql_service_status_t unregister(const char *service_implementation_name) noexcept
Removes previously registered Service Implementation from registry.
Definition: registry.cc:469
static mysql_service_status_t iterator_next(my_h_service_iterator iterator) noexcept
Advances specified iterator to next element.
Definition: registry.cc:619
static void iterator_release(my_h_service_iterator iterator) noexcept
Releases Service implementations iterator.
Definition: registry.cc:565
static mysql_service_status_t release(my_h_service service) noexcept
Releases the Service Implementation previously acquired.
Definition: registry.cc:428
static void rw_lock_deinit()
De-initializes RW lock.
Definition: registry.cc:103
static mysql_service_status_t iterator_create(const char *service_name_pattern, my_h_service_iterator *out_iterator) noexcept
Creates iterator that iterates through all registered Service Implementations.
Definition: registry.cc:535
static bool acquire_nolock(const char *service_name, my_h_service *out_service)
Finds and acquires a Service by name.
Definition: registry.cc:173
static bool unregister_nolock(const char *service_implementation_name)
Removes previously registered Service Implementation from registry.
Definition: registry.cc:292
a Service implementation registry data
Definition: mysql_service_implementation.h:32
std::map< const char *, mysql_service_implementation *, c_string_less > my_service_registry
Definition: registry.cc:56
struct my_h_service_imp * my_h_service
A handle type for acquired Service.
Definition: registry.h:33
std::map< const char *, mysql_service_implementation *, c_string_less > my_service_registry
Definition: registry_imp.h:38
Specifies macros to define Service Implementations.
#define DEFINE_BOOL_METHOD(name, args)
A short macro to define method that returns bool, which is the most common case.
Definition: service_implementation.h:88
#define DEFINE_METHOD(retval, name, args)
A macro to ensure method implementation has required properties, that is it does not throw exceptions...
Definition: service_implementation.h:79
Definition: registry.cc:58
An instrumented rwlock structure.
Definition: mysql_rwlock_bits.h:51