24#ifndef COMPONENT_IMPLEMENTATION_H
25#define COMPONENT_IMPLEMENTATION_H
165#define DECLARE_COMPONENT(source_name, name) \
166 mysql_component_t mysql_component_##source_name = { \
167 name, __##source_name##_provides, __##source_name##_requires, \
168 __##source_name##_metadata,
173#define END_DECLARE_COMPONENT() }
183#define BEGIN_COMPONENT_PROVIDES(name) \
184 static struct mysql_service_ref_t __##name##_provides[] = {
194#define PROVIDES_SERVICE(component, service) \
196#service "." #component, \
197 const_cast < void *> \
198 ((const void *)&SERVICE_IMPLEMENTATION(component, service)) \
204#define END_COMPONENT_PROVIDES() \
214#define BEGIN_COMPONENT_REQUIRES_WITHOUT_REGISTRY(name) \
215 static struct mysql_service_placeholder_ref_t __##name##_requires[] = {
223#define BEGIN_COMPONENT_REQUIRES(name) \
224 REQUIRES_SERVICE_PLACEHOLDER(registry); \
225 static struct mysql_service_placeholder_ref_t __##name##_requires[] = { \
226 REQUIRES_SERVICE(registry),
280#define REQUIRES_SERVICE_PLACEHOLDER(service) \
281 SERVICE_TYPE(service) * mysql_service_##service
296#define REQUIRES_SERVICE_PLACEHOLDER_AS(service, name) \
297 SERVICE_TYPE(service) * name
305#define REQUIRES_SERVICE(service) \
307#service, reinterpret_cast < void **> \
308 (const_cast <mysql_service_##service##_t **>( \
309 &mysql_service_##service)) \
319#define REQUIRES_SERVICE_IMPLEMENTATION(service, implementation) \
321#service "." #implementation, \
322 reinterpret_cast < void **> \
323 (const_cast <mysql_service_##service##_t **>( \
324 &mysql_service_##service)) \
336#define REQUIRES_SERVICE_AS(service, name) \
339 static_cast < void **>(static_cast <void *>( \
340 const_cast <mysql_service_##service##_t **>(&name))) \
353#define REQUIRES_SERVICE_IMPLEMENTATION_AS(service, implementation, name) \
355#service "." #implementation, \
356 static_cast < void **>(static_cast <void *>( \
357 const_cast <mysql_service_##service##_t **>(&name))) \
381#define SERVICE_PLACEHOLDER(service) mysql_service_##service
386#define END_COMPONENT_REQUIRES() \
397#define BEGIN_COMPONENT_METADATA(name) \
398 static struct mysql_metadata_ref_t __##name##_metadata[] = {
406#define METADATA(key, value) \
412#define END_COMPONENT_METADATA() \
422#define DLL_EXPORT extern "C" __declspec(dllexport)
423#define DLL_IMPORT extern "C" __declspec(dllimport)
425#define DLL_EXPORT __declspec(dllexport)
426#define DLL_IMPORT __declspec(dllimport)
430#define DLL_EXPORT extern "C" __attribute__((visibility("default")))
433#define DLL_EXPORT __attribute__((visibility("default")))
446#define DECLARE_LIBRARY_COMPONENTS \
447 mysql_component_t *library_components_list = {
452#define END_DECLARE_LIBRARY_COMPONENTS \
455 DLL_EXPORT mysql_component_t *list_components() { \
456 return library_components_list; \
462#define COMPONENT_REF(name) mysql_component_##name
468#define COMPONENT_ENTRY_FUNC "list_components"
Specifies macros to define Service Implementations.