34template <
typename TService>
73 if (registry->acquire_related(
name, related_service, &
m_service)) {
91 other.m_service =
nullptr;
112 operator TService *()
const {
113 return reinterpret_cast<TService *
>(
m_service);
121 TService *
operator->()
const {
return static_cast<TService *
>(*this); }
129 return static_cast<const my_h_service_imp *
>(this->
m_service) !=
nullptr;
140 TService *save =
reinterpret_cast<TService *
>(
m_service);
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Wraps my_h_service struct conforming ABI into RAII C++ object with ability to cast to desired service...
Definition: my_service.h:35
my_service(const char *name, const mysql_service_registry_t *registry)
An acquire convenience constructor.
Definition: my_service.h:45
my_service(my_h_service service, const mysql_service_registry_t *registry)
Wraps service implementation already acquired.
Definition: my_service.h:84
my_h_service m_service
Definition: my_service.h:146
bool is_valid() const
Definition: my_service.h:127
void acquire(const char *name, const mysql_service_registry_t *registry)
Acquires service by name.
Definition: my_service.h:56
TService * untie()
Unties and returns the underlying service handle.
Definition: my_service.h:139
~my_service()
Definition: my_service.h:110
TService * operator->() const
Returns managed service typed as desired service type to execute operations specified after -> on it.
Definition: my_service.h:121
my_service(my_service< TService > &&other)
Definition: my_service.h:89
my_service(const char *name, my_h_service related_service, const mysql_service_registry_t *registry)
Acquires service by name.
Definition: my_service.h:70
void release()
Releases the reference, if any, and cleans the instance up.
Definition: my_service.h:104
my_service< TService > & operator=(const my_service< TService > &other)=delete
my_service< TService > & operator=(my_service< TService > &other)
Definition: my_service.h:95
my_service()
Default contructor: constructs an empty my_service.
Definition: my_service.h:40
my_service(const my_service< TService > &other)=delete
const mysql_service_registry_t * m_registry
Definition: my_service.h:147
struct my_h_service_imp * my_h_service
A handle type for acquired Service.
Definition: registry.h:33
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76
case opt name
Definition: sslopt-case.h:29
mysql_service_status_t(* release)(my_h_service service)
Releases the Service Implementation previously acquired.
Definition: registry.h:88