Mercurial > hg > orthanc-databases
annotate MySQL/Plugins/MySQLIndex.h @ 272:c7dc70a0a477
upgrade to Orthanc SDK 1.9.2
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 22 Apr 2021 14:09:46 +0200 |
parents | 793bbbe11287 |
children | 16aac0287485 cd9521e04249 |
rev | line source |
---|---|
0 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
193
3236894320d6
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
141
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "../../Framework/Plugins/IndexBackend.h" | |
25 #include "../../Framework/MySQL/MySQLParameters.h" | |
26 | |
27 namespace OrthancDatabases | |
28 { | |
29 class MySQLIndex : public IndexBackend | |
30 { | |
31 private: | |
32 MySQLParameters parameters_; | |
33 bool clearAll_; | |
34 | |
35 public: | |
201
42990b2dd51b
create IDatabaseBackendOutput only if needed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
36 MySQLIndex(OrthancPluginContext* context, |
42990b2dd51b
create IDatabaseBackendOutput only if needed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
37 const MySQLParameters& parameters); |
0 | 38 |
39 void SetClearAll(bool clear) | |
40 { | |
41 clearAll_ = clear; | |
42 } | |
43 | |
255
d663d9e44f8d
reintroduction of IDatabaseFactory into DatabaseManager
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
237
diff
changeset
|
44 virtual IDatabaseFactory* CreateDatabaseFactory() ORTHANC_OVERRIDE; |
224
61c309e06797
added internal class DatabaseBackendAdapterV2::Adapter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
203
diff
changeset
|
45 |
237
35598014f140
refactoring to remove GlobalProperties.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
46 virtual void ConfigureDatabase(DatabaseManager& database) ORTHANC_OVERRIDE; |
226
a4918d57435c
DatabaseManager doesn't IDatabaseFactory anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
225
diff
changeset
|
47 |
260
793bbbe11287
IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
255
diff
changeset
|
48 virtual bool HasRevisionsSupport() const ORTHANC_OVERRIDE |
793bbbe11287
IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
255
diff
changeset
|
49 { |
793bbbe11287
IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
255
diff
changeset
|
50 return false; // TODO - REVISIONS |
793bbbe11287
IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
255
diff
changeset
|
51 } |
793bbbe11287
IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
255
diff
changeset
|
52 |
225
94c9908e6aca
removed DatabaseManager member out of class IndexBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
53 virtual int64_t CreateResource(DatabaseManager& manager, |
94c9908e6aca
removed DatabaseManager member out of class IndexBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
54 const char* publicId, |
111 | 55 OrthancPluginResourceType type) |
56 ORTHANC_OVERRIDE; | |
0 | 57 |
203
2089d4071408
moving classes out of OrthancPlugins namespace, to OrthancDatabases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
58 virtual void DeleteResource(IDatabaseBackendOutput& output, |
225
94c9908e6aca
removed DatabaseManager member out of class IndexBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
59 DatabaseManager& manager, |
201
42990b2dd51b
create IDatabaseBackendOutput only if needed
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
199
diff
changeset
|
60 int64_t id) ORTHANC_OVERRIDE; |
87
48d445f756db
new extension implemented for MySQL: GetLastChangeIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
67
diff
changeset
|
61 |
225
94c9908e6aca
removed DatabaseManager member out of class IndexBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
62 virtual int64_t GetLastChangeIndex(DatabaseManager& manager) ORTHANC_OVERRIDE; |
110
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
63 |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
64 virtual bool HasCreateInstance() const ORTHANC_OVERRIDE |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
65 { |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
66 return true; |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
67 } |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
68 |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
69 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
70 virtual void CreateInstance(OrthancPluginCreateInstanceResult& result, |
225
94c9908e6aca
removed DatabaseManager member out of class IndexBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
71 DatabaseManager& manager, |
110
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
72 const char* hashPatient, |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
73 const char* hashStudy, |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
74 const char* hashSeries, |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
75 const char* hashInstance) |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
76 ORTHANC_OVERRIDE; |
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
77 #endif |
0 | 78 }; |
79 } |