MySQL 9.0.0
Source Code Documentation
|
Specifies macros to define Service Implementations. More...
#include "service.h"
Go to the source code of this file.
Macros | |
#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... | |
Specifies macros to define Service Implementations.
#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.
component | Name of the Component to create implementation in. |
service | Name of the Service to create implementation for. |
#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.
name | Method name. |
args | a list of arguments in parenthesis. |
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.
retval | Type of return value. It cannot contain comma characters, but as only simple structures are possible, this shouldn't be a problem. |
name | Method name. |
args | a list of arguments in parenthesis. |
#define END_SERVICE_IMPLEMENTATION | ( | ) | } |
A macro to end the last declaration of a Service Implementation.
#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 definition structure and variable to be used outside of the component definition context.
component | Name of the implementation of the service. Usually a component name. |
service | Name of the service to create the implementation for. |