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)))                                    \ 
  320#define REQUIRES_SERVICE_IMPLEMENTATION(service, implementation)               \ 
  322#service "." #implementation,                                              \
 
  323        static_cast < void **>                                                 \
 
  324            (static_cast <void *>(const_cast <mysql_service_##service##_t **>( \
 
  325                &mysql_service_##service)))                                    \
 
  337#define REQUIRES_SERVICE_AS(service, name)                                     \ 
  340        static_cast < void **>(static_cast <void *>(                           \ 
  341                          const_cast <mysql_service_##service##_t **>(&name))) \ 
  354#define REQUIRES_SERVICE_IMPLEMENTATION_AS(service, implementation, name)      \ 
  356#service "." #implementation,                                              \
 
  357        static_cast < void **>(static_cast <void *>(                           \
 
  358                          const_cast <mysql_service_##service##_t **>(&name))) \
 
  382#define SERVICE_PLACEHOLDER(service) mysql_service_##service 
  387#define END_COMPONENT_REQUIRES() \ 
  398#define BEGIN_COMPONENT_METADATA(name) \ 
  399  static struct mysql_metadata_ref_t __##name##_metadata[] = { 
  407#define METADATA(key, value) \ 
  413#define END_COMPONENT_METADATA() \ 
  423#define DLL_EXPORT extern "C" __declspec(dllexport)
 
  424#define DLL_IMPORT extern "C" __declspec(dllimport)
 
  426#define DLL_EXPORT __declspec(dllexport) 
  427#define DLL_IMPORT __declspec(dllimport) 
  431#define DLL_EXPORT extern "C" __attribute__((visibility("default")))
 
  434#define DLL_EXPORT __attribute__((visibility("default")))
 
  447#define DECLARE_LIBRARY_COMPONENTS \ 
  448  mysql_component_t *library_components_list = { 
  453#define END_DECLARE_LIBRARY_COMPONENTS              \ 
  456  DLL_EXPORT mysql_component_t *list_components() { \ 
  457    return library_components_list;                 \ 
  463#define COMPONENT_REF(name) mysql_component_##name 
  469#define COMPONENT_ENTRY_FUNC "list_components" 
Specifies macros to define Service Implementations.