MySQL 8.0.39
Source Code Documentation
my_service< TService > Class Template Reference

Wraps my_h_service struct conforming ABI into RAII C++ object with ability to cast to desired service type. More...

#include <my_service.h>

Public Member Functions

 my_service (const char *name, const mysql_service_registry_t *registry)
 Acquires service by name. More...
 
 my_service (const char *name, my_h_service related_service, const mysql_service_registry_t *registry)
 Acquires service by name. More...
 
 my_service (my_h_service service, const mysql_service_registry_t *registry)
 Wraps service implementation already acquired. More...
 
 my_service (const my_service< TService > &other)=delete
 
 my_service (my_service< TService > &&other)
 
 ~my_service ()
 
 operator TService * () const
 
 operator my_h_service () const
 
TService * operator-> () const
 Returns managed service typed as desired service type to execute operations specified after -> on it. More...
 
 operator bool () const
 
bool is_valid () const
 
TService * untie ()
 Unties and returns the underlying service handle. More...
 

Private Attributes

my_h_service m_service
 
const mysql_service_registry_tm_registry
 

Detailed Description

template<typename TService>
class my_service< TService >

Wraps my_h_service struct conforming ABI into RAII C++ object with ability to cast to desired service type.

Constructor & Destructor Documentation

◆ my_service() [1/5]

template<typename TService >
my_service< TService >::my_service ( const char *  name,
const mysql_service_registry_t registry 
)
inline

Acquires service by name.

Parameters
nameName of service, with or without component name, to acquire.
registryHandle to registry service to use. The registry service must be valid (i.e. not released) up to the moment when this instance dies.

◆ my_service() [2/5]

template<typename TService >
my_service< TService >::my_service ( const char *  name,
my_h_service  related_service,
const mysql_service_registry_t registry 
)
inline

Acquires service by name.

Parameters
nameName of service, with or without component name, to acquire.
related_serviceHandle to service to acquire related to.
registryHandle to registry service to use.

◆ my_service() [3/5]

template<typename TService >
my_service< TService >::my_service ( my_h_service  service,
const mysql_service_registry_t registry 
)
inline

Wraps service implementation already acquired.

Parameters
serviceService handle to manage.
registryHandle to registry service to use.

◆ my_service() [4/5]

template<typename TService >
my_service< TService >::my_service ( const my_service< TService > &  other)
delete

◆ my_service() [5/5]

template<typename TService >
my_service< TService >::my_service ( my_service< TService > &&  other)
inline

◆ ~my_service()

template<typename TService >
my_service< TService >::~my_service ( )
inline

Member Function Documentation

◆ is_valid()

template<typename TService >
bool my_service< TService >::is_valid ( ) const
inline

◆ operator bool()

template<typename TService >
my_service< TService >::operator bool ( ) const
inline
Return values
falseObject manages valid service.
trueObject does not manage any service.

◆ operator my_h_service()

template<typename TService >
my_service< TService >::operator my_h_service ( ) const
inline

◆ operator TService *()

template<typename TService >
my_service< TService >::operator TService * ( ) const
inline

◆ operator->()

template<typename TService >
TService * my_service< TService >::operator-> ( ) const
inline

Returns managed service typed as desired service type to execute operations specified after -> on it.

◆ untie()

template<typename TService >
TService * my_service< TService >::untie ( )
inline

Unties and returns the underlying service handle.

It will not be released by the destructor.

Return values
thehandle

Member Data Documentation

◆ m_registry

template<typename TService >
const mysql_service_registry_t* my_service< TService >::m_registry
private

◆ m_service

template<typename TService >
my_h_service my_service< TService >::m_service
private

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