annotate Odbc/Plugins/OdbcIndex.h @ 368:82f73188b58d attach-custom-data

fix warnings
author Alain Mazy <am@osimis.io>
date Wed, 01 Feb 2023 16:24:37 +0100
parents cd9521e04249
children f18e46d7dbf8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
329
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "../../Framework/Plugins/IndexBackend.h"
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 namespace OrthancDatabases
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 {
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 class OdbcIndex : public IndexBackend
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 private:
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 unsigned int maxConnectionRetries_;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 unsigned int connectionRetryInterval_;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 std::string connectionString_;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 public:
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 OdbcIndex(OrthancPluginContext* context,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 const std::string& connectionString);
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 unsigned int GetMaxConnectionRetries() const
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 {
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 return maxConnectionRetries_;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 }
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 void SetMaxConnectionRetries(unsigned int retries)
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 {
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 maxConnectionRetries_ = retries;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 }
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 unsigned int GetConnectionRetryInterval() const
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 return connectionRetryInterval_;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 void SetConnectionRetryInterval(unsigned int seconds);
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 virtual IDatabaseFactory* CreateDatabaseFactory() ORTHANC_OVERRIDE;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 virtual void ConfigureDatabase(DatabaseManager& manager) ORTHANC_OVERRIDE;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 virtual bool HasRevisionsSupport() const ORTHANC_OVERRIDE
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 {
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 return true;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 }
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
366
cd9521e04249 DatabaseBackendAdapterV4: added support for customData + revision when not already done
Alain Mazy <am@osimis.io>
parents: 329
diff changeset
65 bool HasAttachmentCustomDataSupport() const ORTHANC_OVERRIDE
cd9521e04249 DatabaseBackendAdapterV4: added support for customData + revision when not already done
Alain Mazy <am@osimis.io>
parents: 329
diff changeset
66 {
cd9521e04249 DatabaseBackendAdapterV4: added support for customData + revision when not already done
Alain Mazy <am@osimis.io>
parents: 329
diff changeset
67 return true;
cd9521e04249 DatabaseBackendAdapterV4: added support for customData + revision when not already done
Alain Mazy <am@osimis.io>
parents: 329
diff changeset
68 }
cd9521e04249 DatabaseBackendAdapterV4: added support for customData + revision when not already done
Alain Mazy <am@osimis.io>
parents: 329
diff changeset
69
329
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 virtual int64_t CreateResource(DatabaseManager& manager,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 const char* publicId,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 OrthancPluginResourceType type) ORTHANC_OVERRIDE;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 virtual void DeleteResource(IDatabaseBackendOutput& output,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 DatabaseManager& manager,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 int64_t id) ORTHANC_OVERRIDE;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 virtual void LogChange(DatabaseManager& manager,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 int32_t changeType,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 int64_t resourceId,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 OrthancPluginResourceType resourceType,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 const char* date) ORTHANC_OVERRIDE;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 virtual int64_t GetLastChangeIndex(DatabaseManager& manager) ORTHANC_OVERRIDE;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 virtual void DeleteAttachment(IDatabaseBackendOutput& output,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 DatabaseManager& manager,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 int64_t id,
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 int32_t attachment) ORTHANC_OVERRIDE;
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 };
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 }