MySQL 8.1.0
Source Code Documentation
mock_server_component.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018, 2023, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is also distributed with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have included with MySQL.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23*/
24
25#ifndef MYSQLROUTER_MOCK_SERVER_COMPONENT_INCLUDED
26#define MYSQLROUTER_MOCK_SERVER_COMPONENT_INCLUDED
27
28#include <memory>
29#include <vector>
30
34
35namespace server_mock {
36class MySQLServerMock;
37}
38
40 public:
41 // disable copy, as we are a single-instance
43 void operator=(MockServerComponent const &) = delete;
44
45 static MockServerComponent &get_instance();
46
47 void register_server(const std::string &name,
48 std::shared_ptr<server_mock::MySQLServerMock> srv);
49
50 std::shared_ptr<MockServerGlobalScope> get_global_scope();
51 void close_all_connections();
52
53 private:
55 srvs_{{}};
56
58};
59
60#endif
Definition: mock_server_component.h:39
MockServerComponent(MockServerComponent const &)=delete
MockServerComponent()=default
void operator=(MockServerComponent const &)=delete
Monitor pattern.
Definition: monitor.h:38
Main class.
Definition: mysql_server_mock.h:51
#define MOCK_SERVER_EXPORT
Definition: mock_server_export.h:39
Definition: mock_server_component.h:35
Definition: srv0dynamic_procedures.h:47
case opt name
Definition: sslopt-case.h:32