annotate MySQL/Plugins/MySQLStorageArea.h @ 185:7c46155b5bb4

fix mingw build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 16 Dec 2020 13:59:17 +0100
parents 0b3e9ee53c46
children 6fe74f9a516e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
140
4cd7e45b671e upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 67
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
17
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "../../Framework/Plugins/StorageBackend.h"
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "../../Framework/MySQL/MySQLParameters.h"
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 namespace OrthancDatabases
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 class MySQLStorageArea : public StorageBackend
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 {
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 private:
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 class Factory : public IDatabaseFactory
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 private:
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 MySQLStorageArea& that_;
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 public:
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 Factory(MySQLStorageArea& that) :
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 that_(that)
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 {
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 }
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 virtual Dialect GetDialect() const
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 {
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 return Dialect_MySQL;
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 }
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 virtual IDatabase* Open()
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 return that_.OpenInternal();
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
141
0b3e9ee53c46 Added 'MaximumConnectionRetries' & 'ConnectionRetryInterval' to configure the retries when connecting to the DB at startup
Alain Mazy <alain@mazy.be>
parents: 140
diff changeset
53
0b3e9ee53c46 Added 'MaximumConnectionRetries' & 'ConnectionRetryInterval' to configure the retries when connecting to the DB at startup
Alain Mazy <alain@mazy.be>
parents: 140
diff changeset
54 virtual void GetConnectionRetriesParameters(unsigned int& maxConnectionRetries, unsigned int& connectionRetryInterval)
0b3e9ee53c46 Added 'MaximumConnectionRetries' & 'ConnectionRetryInterval' to configure the retries when connecting to the DB at startup
Alain Mazy <alain@mazy.be>
parents: 140
diff changeset
55 {
0b3e9ee53c46 Added 'MaximumConnectionRetries' & 'ConnectionRetryInterval' to configure the retries when connecting to the DB at startup
Alain Mazy <alain@mazy.be>
parents: 140
diff changeset
56 maxConnectionRetries = that_.parameters_.GetMaxConnectionRetries();
0b3e9ee53c46 Added 'MaximumConnectionRetries' & 'ConnectionRetryInterval' to configure the retries when connecting to the DB at startup
Alain Mazy <alain@mazy.be>
parents: 140
diff changeset
57 connectionRetryInterval = that_.parameters_.GetConnectionRetryInterval();
0b3e9ee53c46 Added 'MaximumConnectionRetries' & 'ConnectionRetryInterval' to configure the retries when connecting to the DB at startup
Alain Mazy <alain@mazy.be>
parents: 140
diff changeset
58 }
17
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 };
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 OrthancPluginContext* context_;
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 MySQLParameters parameters_;
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 bool clearAll_;
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 IDatabase* OpenInternal();
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 public:
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 MySQLStorageArea(const MySQLParameters& parameters);
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 void SetClearAll(bool clear)
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 {
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 clearAll_ = clear;
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 }
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 };
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 }