24#ifndef MY_REGISTRY_QUERY_H
25#define MY_REGISTRY_QUERY_H
32#include <unordered_set>
61 this->erase(this->
begin(), this->
end());
77 while (!svc->is_valid(iter)) {
78 const char *
name{
nullptr};
79 if (svc->get(iter, &
name))
return true;
80 if (
name ==
nullptr)
return true;
81 size_t name_len = strlen(
name);
88 if (svc->next(iter))
break;
135template <
class ServiceType>
166 auto res = this->
insert(
reinterpret_cast<ServiceType *
>(hsvc));
179 for (
auto svc : *
this) {
181 const_cast<void *
>(
reinterpret_cast<const void *
>(svc))));
183 this->erase(this->
begin(), this->
end());
A service acquiring registry query convenience class.
Definition: my_registry_query.h:136
bool init()
Call this method to populate the data into the class.
Definition: my_registry_query.h:161
const std::string m_service_name
Definition: my_registry_query.h:137
My_registry_query_string m_string_list
Definition: my_registry_query.h:139
const mysql_service_registry_t * m_registry
Definition: my_registry_query.h:138
My_registry_query_and_acquire(My_registry_query_and_acquire &&other)=delete
~My_registry_query_and_acquire()
Definition: my_registry_query.h:153
My_registry_query_and_acquire(const char *service_name, const mysql_service_registry_t *reg, const mysql_service_registry_query_t *reg_query=nullptr)
Definition: my_registry_query.h:142
void reset()
Properly releases and disposes of all the references.
Definition: my_registry_query.h:178
My_registry_query_and_acquire(const My_registry_query_and_acquire &other)=delete
A registry query convenience class.
Definition: my_registry_query.h:53
My_registry_query_string(My_registry_query_string &&other)=delete
~My_registry_query_string()
Definition: my_registry_query.h:111
My_registry_query_string(const char *service_name, const mysql_service_registry_t *reg, const mysql_service_registry_query_t *reg_query=nullptr)
Definition: my_registry_query.h:95
const mysql_service_registry_query_t * m_registry_query
Definition: my_registry_query.h:56
my_h_service m_reg_query_handle
Definition: my_registry_query.h:57
bool init()
Definition: my_registry_query.h:60
const std::string m_service_name
Definition: my_registry_query.h:54
const mysql_service_registry_t * m_registry
Definition: my_registry_query.h:55
My_registry_query_string(const My_registry_query_string &other)=delete
Wraps my_h_service struct conforming ABI into RAII C++ object with ability to cast to desired service...
Definition: my_service.h:35
bool is_valid() const
Definition: my_service.h:127
TService * untie()
Unties and returns the underlying service handle.
Definition: my_service.h:139
struct my_h_service_imp * my_h_service
A handle type for acquired Service.
Definition: registry.h:33
void insert(dd::cache::SPI_lru_cache_owner_ptr &c, dd::Object_id id)
Definition: dictionary_client.cc:3284
const char * begin(const char *const c)
Definition: base64.h:44
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
std::unordered_set< Key, std::hash< Key >, std::equal_to< Key >, ut::allocator< Key > > unordered_set
Definition: ut0new.h:2889
Scope_guard< TLambda > create_scope_guard(const TLambda rollback_lambda)
Create a scope guard object.
Definition: scope_guard.h:113
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76
#define SERVICE_TYPE_NO_CONST(name)
Generates the standard Service type name.
Definition: service.h:71
case opt name
Definition: sslopt-case.h:29
Definition: registry.cc:48
mysql_service_status_t(* release)(my_h_service service)
Releases the Service Implementation previously acquired.
Definition: registry.h:88
mysql_service_status_t(* acquire)(const char *service_name, my_h_service *out_service)
Finds and acquires a Service by name.
Definition: registry.h:61