MySQL 8.0.40
Source Code Documentation
mysql_harness::BuiltinPlugins Class Reference

Singleton class implementing registry of the built-in MySQLRouter plugins. More...

#include <builtin_plugins.h>

Classes

struct  PluginInfo
 Stores the information about a single built-in plugin. More...
 

Public Types

using PluginsMap = std::map< std::string, PluginInfo >
 

Public Member Functions

 BuiltinPlugins (const BuiltinPlugins &)=delete
 It's a singleton so we disable copying. More...
 
BuiltinPluginsoperator= (const BuiltinPlugins &)=delete
 
bool has (const std::string &plugin_name) noexcept
 Checks if there is a built-in plugin with a specified name. More...
 
const PluginsMapget () noexcept
 Returns the map containing information about all built-in plugins in the registry. More...
 
Plugin * get_plugin (const std::string &plugin_name)
 Returns pointer to the Plugin struct for the plugin with selected name. More...
 
void add (std::string name, PluginInfo plugin_info)
 add plugin to the built in plugins. More...
 

Static Public Member Functions

static BuiltinPluginsinstance ()
 Gets the singleton instance. More...
 

Private Member Functions

 BuiltinPlugins ()
 

Private Attributes

PluginsMap plugins_
 

Detailed Description

Singleton class implementing registry of the built-in MySQLRouter plugins.

Built-in plugin is statically linked to the harness library (does not have dedicated .so or .dll file) but implements the same API as the external plugin (init(), start(), etc.) that is called by the Loader.

Member Typedef Documentation

◆ PluginsMap

using mysql_harness::BuiltinPlugins::PluginsMap = std::map<std::string, PluginInfo>

Constructor & Destructor Documentation

◆ BuiltinPlugins() [1/2]

mysql_harness::BuiltinPlugins::BuiltinPlugins ( const BuiltinPlugins )
delete

It's a singleton so we disable copying.

◆ BuiltinPlugins() [2/2]

mysql_harness::BuiltinPlugins::BuiltinPlugins ( )
private

Member Function Documentation

◆ add()

void mysql_harness::BuiltinPlugins::add ( std::string  name,
PluginInfo  plugin_info 
)

add plugin to the built in plugins.

◆ get()

const PluginsMap * mysql_harness::BuiltinPlugins::get ( )
inlinenoexcept

Returns the map containing information about all built-in plugins in the registry.

Returns
map containing information about all built-in plugins in the registry

◆ get_plugin()

Plugin * mysql_harness::BuiltinPlugins::get_plugin ( const std::string &  plugin_name)
inline

Returns pointer to the Plugin struct for the plugin with selected name.

Exceptions
std::out_of_rangeif there is no info about the plugin with a given name.
Parameters
plugin_namename of the plugin queried for the Plugin struct
Returns
Plugin struct for the plugin with selected name

◆ has()

bool mysql_harness::BuiltinPlugins::has ( const std::string &  plugin_name)
noexcept

Checks if there is a built-in plugin with a specified name.

Parameters
plugin_nameplugin name to check
Returns
true if there is a built-in plugin with a given name in the registry, false otherwise

◆ instance()

BuiltinPlugins & mysql_harness::BuiltinPlugins::instance ( )
static

Gets the singleton instance.

◆ operator=()

BuiltinPlugins & mysql_harness::BuiltinPlugins::operator= ( const BuiltinPlugins )
delete

Member Data Documentation

◆ plugins_

PluginsMap mysql_harness::BuiltinPlugins::plugins_
private

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