MySQL  8.0.17
Source Code Documentation
service_implementation.h File Reference

Specifies macros to define Service Implementations. More...

#include "service.h"

Go to the source code of this file.

Macros

#define SERVICE_IMPLEMENTATION_H
 
#define SERVICE_IMPLEMENTATION(component, service)   imp_##component##_##service
 
#define BEGIN_SERVICE_IMPLEMENTATION(component, service)   SERVICE_TYPE(service) SERVICE_IMPLEMENTATION(component, service) = {
 
#define END_SERVICE_IMPLEMENTATION()   }
 
#define DEFINE_METHOD(retval, name, args)   retval name args noexcept
 
#define DEFINE_BOOL_METHOD(name, args)   DEFINE_METHOD(mysql_service_status_t, name, args)
 
#define SERVICE_IMPLEMENTATION(component, service)   imp_##component##_##service
 Reference to the name of the service implementation variable. More...
 
#define BEGIN_SERVICE_IMPLEMENTATION(component, service)   SERVICE_TYPE(service) SERVICE_IMPLEMENTATION(component, service) = {
 Declares a Service Implementation. More...
 
#define END_SERVICE_IMPLEMENTATION()   }
 A macro to end the last declaration of a Service Implementation. More...
 
#define DEFINE_METHOD(retval, name, args)   retval name args noexcept
 A macro to ensure method implementation has required properties, that is it does not throw exceptions and is static. More...
 
#define DEFINE_BOOL_METHOD(name, args)   DEFINE_METHOD(mysql_service_status_t, name, args)
 A short macro to define method that returns bool, which is the most common case. More...
 

Detailed Description

Specifies macros to define Service Implementations.

Macro Definition Documentation

◆ BEGIN_SERVICE_IMPLEMENTATION [1/2]

#define BEGIN_SERVICE_IMPLEMENTATION (   component,
  service 
)    SERVICE_TYPE(service) SERVICE_IMPLEMENTATION(component, service) = {

◆ BEGIN_SERVICE_IMPLEMENTATION [2/2]

#define BEGIN_SERVICE_IMPLEMENTATION (   component,
  service 
)    SERVICE_TYPE(service) SERVICE_IMPLEMENTATION(component, service) = {

Declares a Service Implementation.

It builds standard implementation info structure. Only a series of pointers to methods the Service Implementation implements as respective Service methods are expected to be used after this macro and before the END_SERVICE_IMPLEMENTATION counterpart.

Parameters
componentName of the Component to create implementation in.
serviceName of the Service to create implementation for.

◆ DEFINE_BOOL_METHOD [1/2]

#define DEFINE_BOOL_METHOD (   name,
  args 
)    DEFINE_METHOD(mysql_service_status_t, name, args)

A short macro to define method that returns bool, which is the most common case.

Parameters
nameMethod name.
argsa list of arguments in parenthesis.

◆ DEFINE_BOOL_METHOD [2/2]

#define DEFINE_BOOL_METHOD (   name,
  args 
)    DEFINE_METHOD(mysql_service_status_t, name, args)

◆ DEFINE_METHOD [1/2]

#define DEFINE_METHOD (   retval,
  name,
  args 
)    retval name args noexcept

◆ DEFINE_METHOD [2/2]

#define DEFINE_METHOD (   retval,
  name,
  args 
)    retval name args noexcept

A macro to ensure method implementation has required properties, that is it does not throw exceptions and is static.

This macro should be used with exactly the same arguments as DECLARE_METHOD.

Parameters
retvalType of return value. It cannot contain comma characters, but as only simple structures are possible, this shouldn't be a problem.
nameMethod name.
argsa list of arguments in parenthesis.

◆ END_SERVICE_IMPLEMENTATION [1/2]

#define END_SERVICE_IMPLEMENTATION ( )    }

◆ END_SERVICE_IMPLEMENTATION [2/2]

#define END_SERVICE_IMPLEMENTATION ( )    }

A macro to end the last declaration of a Service Implementation.

◆ SERVICE_IMPLEMENTATION [1/2]

#define SERVICE_IMPLEMENTATION (   component,
  service 
)    imp_##component##_##service

Reference to the name of the service implementation variable.

BEGIN_SERVICE_IMPLEMENTATION defines a local variable of the structure type for the service (see SERVICE_TYPE). The variable is then used by the PROVIDES_SERVICE macro to construct the list of service provided by the component. This macro allows one to use BEGIN_SERVICE_IMPLEMENTATION , DEFINE_METHOD and END_SERVICE_IMPLEMENTATION macros to build a service defintion structure and variable to be used outside of the component definition context.

Parameters
componentName of the implementation of the service. Usually a component name.
serviceName of the service to create the implementation for.

◆ SERVICE_IMPLEMENTATION [2/2]

#define SERVICE_IMPLEMENTATION (   component,
  service 
)    imp_##component##_##service

◆ SERVICE_IMPLEMENTATION_H

#define SERVICE_IMPLEMENTATION_H