MySQL 9.3.0
Source Code Documentation
My_registry_query_and_acquire< ServiceType > Class Template Reference

A service acquiring registry query convenience class. More...

#include <my_registry_query.h>

Inheritance diagram for My_registry_query_and_acquire< ServiceType >:
[legend]

Public Member Functions

 My_registry_query_and_acquire (const char *service_name, const mysql_service_registry_t *reg, const mysql_service_registry_query_t *reg_query=nullptr)
 
 My_registry_query_and_acquire (const My_registry_query_and_acquire &other)=delete
 
 My_registry_query_and_acquire (My_registry_query_and_acquire &&other)=delete
 
 ~My_registry_query_and_acquire ()
 
bool init ()
 Call this method to populate the data into the class. More...
 
void reset ()
 Properly releases and disposes of all the references. More...
 

Private Attributes

const std::string m_service_name
 
const mysql_service_registry_tm_registry
 
My_registry_query_string m_string_list
 

Detailed Description

template<class ServiceType>
class My_registry_query_and_acquire< ServiceType >

A service acquiring registry query convenience class.

Uses the My_registry_query_string class to get a list of service names matching the pattern, acquires references for these and keeps them until the instance's destruction.

Typical use pattern is:

My_registry_query_and_acquire<SERVICE_TYPE(foo)> qry("foo", registry_ref);
if (qry->init()) error_out();
for (SERVICE_TYPE(foo) *x : qry) {
x->method();
}
A service acquiring registry query convenience class.
Definition: my_registry_query.h:136
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76
See also
My_registry_query_string

Constructor & Destructor Documentation

◆ My_registry_query_and_acquire() [1/3]

template<class ServiceType >
My_registry_query_and_acquire< ServiceType >::My_registry_query_and_acquire ( const char *  service_name,
const mysql_service_registry_t reg,
const mysql_service_registry_query_t reg_query = nullptr 
)
inline

◆ My_registry_query_and_acquire() [2/3]

template<class ServiceType >
My_registry_query_and_acquire< ServiceType >::My_registry_query_and_acquire ( const My_registry_query_and_acquire< ServiceType > &  other)
delete

◆ My_registry_query_and_acquire() [3/3]

template<class ServiceType >
My_registry_query_and_acquire< ServiceType >::My_registry_query_and_acquire ( My_registry_query_and_acquire< ServiceType > &&  other)
delete

◆ ~My_registry_query_and_acquire()

template<class ServiceType >
My_registry_query_and_acquire< ServiceType >::~My_registry_query_and_acquire ( )
inline

Member Function Documentation

◆ init()

template<class ServiceType >
bool My_registry_query_and_acquire< ServiceType >::init ( )
inline

Call this method to populate the data into the class.

Return values
truefailure
falsesuccess

◆ reset()

template<class ServiceType >
void My_registry_query_and_acquire< ServiceType >::reset ( )
inline

Properly releases and disposes of all the references.

Called by the destructor too

Member Data Documentation

◆ m_registry

template<class ServiceType >
const mysql_service_registry_t* My_registry_query_and_acquire< ServiceType >::m_registry
private

◆ m_service_name

template<class ServiceType >
const std::string My_registry_query_and_acquire< ServiceType >::m_service_name
private

◆ m_string_list

template<class ServiceType >
My_registry_query_string My_registry_query_and_acquire< ServiceType >::m_string_list
private

The documentation for this class was generated from the following file: