11 #ifndef ASIO_DETAIL_SERVICE_REGISTRY_HPP 12 #define ASIO_DETAIL_SERVICE_REGISTRY_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 #include "asio/detail/config.hpp" 20 #include "asio/detail/mutex.hpp" 21 #include "asio/detail/noncopyable.hpp" 22 #include "asio/detail/type_traits.hpp" 23 #include "asio/execution_context.hpp" 25 #include "asio/detail/push_options.hpp" 44 ASIO_DECL ~service_registry();
47 ASIO_DECL
void shutdown_services();
50 ASIO_DECL
void destroy_services();
58 template <
typename Service>
59 Service& use_service();
66 template <
typename Service>
71 template <
typename Service>
72 void add_service(Service* new_service);
75 template <
typename Service>
76 bool has_service()
const;
80 template <
typename Service>
81 static void init_key(execution_context::service::key& key, ...);
83 #if !defined(ASIO_NO_TYPEID) 85 template <
typename Service>
86 static void init_key(execution_context::service::key& key,
88 is_base_of<typename Service::key_type, Service>::value>::type*);
89 #endif // !defined(ASIO_NO_TYPEID) 92 ASIO_DECL
static void init_key_from_id(
93 execution_context::service::key& key,
96 #if !defined(ASIO_NO_TYPEID) 98 template <
typename Service>
99 static void init_key_from_id(execution_context::service::key& key,
101 #endif // !defined(ASIO_NO_TYPEID) 104 ASIO_DECL
static bool keys_match(
105 const execution_context::service::key& key1,
106 const execution_context::service::key& key2);
112 template <
typename Service,
typename Owner>
119 struct auto_service_ptr;
120 friend struct auto_service_ptr;
121 struct auto_service_ptr
124 ~auto_service_ptr() { destroy(ptr_); }
131 const execution_context::service::key& key,
132 factory_type factory,
void* owner);
136 ASIO_DECL
void do_add_service(
137 const execution_context::service::key& key,
141 ASIO_DECL
bool do_has_service(
142 const execution_context::service::key& key)
const;
157 #include "asio/detail/pop_options.hpp" 159 #include "asio/detail/impl/service_registry.hpp" 160 #if defined(ASIO_HEADER_ONLY) 161 # include "asio/detail/impl/service_registry.ipp" 162 #endif // defined(ASIO_HEADER_ONLY) 164 #endif // ASIO_DETAIL_SERVICE_REGISTRY_HPP Definition: null_mutex.hpp:30
Definition: noncopyable.hpp:25
Class used to uniquely identify a service.
Definition: execution_context.hpp:306
Base class for all io_context services.
Definition: execution_context.hpp:315
Definition: service_registry.hpp:36
A context for function object execution.
Definition: execution_context.hpp:105
Definition: service_registry.hpp:34
Provides core I/O functionality.
Definition: io_context.hpp:211
Definition: type_traits.hpp:97
fork_event
Fork-related event notifications.
Definition: execution_context.hpp:142
Definition: any_io_executor.hpp:28
Definition: execution_context.hpp:379