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) \
308 static_cast < void **> \
309 (static_cast <void *>(const_cast <mysql_service_##service##_t **>( \
310 &mysql_service_##service))) \
322#define REQUIRES_SERVICE_AS(service, name) \
325 static_cast < void **>(static_cast <void *>( \
326 const_cast <mysql_service_##service##_t **>(&name))) \
350#define SERVICE_PLACEHOLDER(service) mysql_service_##service
355#define END_COMPONENT_REQUIRES() \
366#define BEGIN_COMPONENT_METADATA(name) \
367 static struct mysql_metadata_ref_t __##name##_metadata[] = {
375#define METADATA(key, value) \
381#define END_COMPONENT_METADATA() \
391#define DLL_EXPORT extern "C" __declspec(dllexport)
392#define DLL_IMPORT extern "C" __declspec(dllimport)
394#define DLL_EXPORT __declspec(dllexport)
395#define DLL_IMPORT __declspec(dllimport)
399#define DLL_EXPORT extern "C" __attribute__((visibility("default")))
402#define DLL_EXPORT __attribute__((visibility("default")))
415#define DECLARE_LIBRARY_COMPONENTS \
416 mysql_component_t *library_components_list = {
421#define END_DECLARE_LIBRARY_COMPONENTS \
424 DLL_EXPORT mysql_component_t *list_components() { \
425 return library_components_list; \
431#define COMPONENT_REF(name) mysql_component_##name
437#define COMPONENT_ENTRY_FUNC "list_components"
Specifies macros to define Service Implementations.