23#ifndef COMPONENT_IMPLEMENTATION_H
24#define COMPONENT_IMPLEMENTATION_H
164#define DECLARE_COMPONENT(source_name, name) \
165 mysql_component_t mysql_component_##source_name = { \
166 name, __##source_name##_provides, __##source_name##_requires, \
167 __##source_name##_metadata,
172#define END_DECLARE_COMPONENT() }
182#define BEGIN_COMPONENT_PROVIDES(name) \
183 static struct mysql_service_ref_t __##name##_provides[] = {
193#define PROVIDES_SERVICE(component, service) \
195#service "." #component, \
196 const_cast < void *> \
197 ((const void *)&SERVICE_IMPLEMENTATION(component, service)) \
203#define END_COMPONENT_PROVIDES() \
213#define BEGIN_COMPONENT_REQUIRES_WITHOUT_REGISTRY(name) \
214 static struct mysql_service_placeholder_ref_t __##name##_requires[] = {
222#define BEGIN_COMPONENT_REQUIRES(name) \
223 REQUIRES_SERVICE_PLACEHOLDER(registry); \
224 static struct mysql_service_placeholder_ref_t __##name##_requires[] = { \
225 REQUIRES_SERVICE(registry),
279#define REQUIRES_SERVICE_PLACEHOLDER(service) \
280 SERVICE_TYPE(service) * mysql_service_##service
295#define REQUIRES_SERVICE_PLACEHOLDER_AS(service, name) \
296 SERVICE_TYPE(service) * name
304#define REQUIRES_SERVICE(service) \
307 static_cast < void **> \
308 (static_cast <void *>(const_cast <mysql_service_##service##_t **>( \
309 &mysql_service_##service))) \
321#define REQUIRES_SERVICE_AS(service, name) \
324 static_cast < void **>(static_cast <void *>( \
325 const_cast <mysql_service_##service##_t **>(&name))) \
349#define SERVICE_PLACEHOLDER(service) mysql_service_##service
354#define END_COMPONENT_REQUIRES() \
365#define BEGIN_COMPONENT_METADATA(name) \
366 static struct mysql_metadata_ref_t __##name##_metadata[] = {
374#define METADATA(key, value) \
380#define END_COMPONENT_METADATA() \
390#define DLL_EXPORT extern "C" __declspec(dllexport)
391#define DLL_IMPORT extern "C" __declspec(dllimport)
393#define DLL_EXPORT __declspec(dllexport)
394#define DLL_IMPORT __declspec(dllimport)
398#define DLL_EXPORT extern "C" __attribute__((visibility("default")))
401#define DLL_EXPORT __attribute__((visibility("default")))
414#define DECLARE_LIBRARY_COMPONENTS \
415 mysql_component_t *library_components_list = {
420#define END_DECLARE_LIBRARY_COMPONENTS \
423 DLL_EXPORT mysql_component_t *list_components() { \
424 return library_components_list; \
430#define COMPONENT_REF(name) mysql_component_##name
436#define COMPONENT_ENTRY_FUNC "list_components"
Specifies macros to define Service Implementations.