![]() |
MySQL 8.0.43
Source Code Documentation
|
Go to the source code of this file.
Macros | |
| #define | SERVICE_TYPE_NO_CONST(name) mysql_service_##name##_t |
| Generates the standard Service type name. More... | |
| #define | SERVICE_TYPE(name) const SERVICE_TYPE_NO_CONST(name) |
| Generates the standard Service type name. More... | |
| #define | BEGIN_SERVICE_DEFINITION(name) typedef struct s_mysql_##name { |
| Declares a new Service. More... | |
| #define | END_SERVICE_DEFINITION(name) |
| A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro. More... | |
| #define | DECLARE_METHOD(retval, name, args) retval(*name) args |
| Declares a method as a part of the Service definition. More... | |
| #define | DECLARE_BOOL_METHOD(name, args) DECLARE_METHOD(mysql_service_status_t, name, args) |
| Declares a method that returns bool as a part of the Service definition. More... | |
| #define | DEFINE_SERVICE_HANDLE(name) typedef struct name##_imp *name |
| Defines an object type that is meant for carrying handles to the implementation-specific objects used in the Service interface, but without their structure exposed, keeping it as an abstraction. More... | |
Typedefs | |
| typedef int | mysql_service_status_t |
| Specific type for the service status return values. More... | |
Declares a new Service.
It creates a structure for pointers to Service methods. A list of methods defined using DECLARE_METHOD and DECLARE_BOOL_METHOD macros must follow this macro, with a closing END_SERVICE_DEFINITION macro usage.
| name | Service name, must be a valid C name. |
| #define DECLARE_BOOL_METHOD | ( | name, | |
| args | |||
| ) | DECLARE_METHOD(mysql_service_status_t, name, args) |
Declares a method that returns bool as a part of the Service definition.
To be used within the SERVICE_DEFINITION macro.
| name | Name of the method, must be a valid C name. |
| args | The list of arguments of the method taken in parentheses. |
Declares a method as a part of the Service definition.
To be used within the SERVICE_DEFINITION macro.
| retval | Type of the return value for the method declaration. Should be a simple type or structure, not a C++ object with undefined ABI. |
| name | Name of the method, must be a valid C name. |
| args | The list of arguments of the method taken in parentheses. |
Defines an object type that is meant for carrying handles to the implementation-specific objects used in the Service interface, but without their structure exposed, keeping it as an abstraction.
This follows a Opaque Pointer design pattern, see more: https://en.wikipedia.org/wiki/Opaque_pointer If you would like to have a C++ RAII class to manage the resource with additional methods to call raw service calls, please create your class {handle_name} instead of following macro. Please make sure it does not use any virtual methods to keep binary compatibility, and try use only one member, the d-pointer to hide all implementation details and keep headers unmodified from the point of publishing it.
| name | Handle name, must be a valid C name. |
| #define END_SERVICE_DEFINITION | ( | name | ) |
| #define SERVICE_TYPE | ( | name | ) | const SERVICE_TYPE_NO_CONST(name) |
Generates the standard Service type name.
Generates the standard Service type name.
It does not have const specifier, it should be used only when really necessary.
| typedef int mysql_service_status_t |
Specific type for the service status return values.
0 is false, non-zero is true. Corresponds to C++ bool.