annotate OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.h @ 5811:a451777236fb attach-custom-data tip

advanced storage: fix + customizable path
author Alain Mazy <am@orthanc.team>
date Tue, 24 Sep 2024 17:52:45 +0200
parents 1f6642c04541
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5207
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
5640
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5517
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5517
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5485
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5220
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
5207
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
5811
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
10 * modify it under the terms of the GNU General Public License as
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
12 * License, or (at your option) any later version.
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
13 *
5207
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
5811
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
17 * General Public License for more details.
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
18 *
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
19 * You should have received a copy of the GNU General Public License
5207
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
5811
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
26 #if ORTHANC_ENABLE_PLUGINS == 1
5207
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
5811
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
28 #include "../../../OrthancFramework/Sources/SharedLibrary.h"
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
29 #include "../../Sources/Database/IDatabaseWrapper.h"
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
30 #include "../Include/orthanc/OrthancCPlugin.h"
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
31 #include "PluginsErrorDictionary.h"
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
32
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
33 namespace Orthanc
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
34 {
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
35 class OrthancPluginDatabaseV4 : public IDatabaseWrapper
5207
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 {
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 private:
5811
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
38 class Transaction;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
39
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
40 SharedLibrary& library_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
41 PluginsErrorDictionary& errorDictionary_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
42 _OrthancPluginRegisterDatabaseBackendV4 definition_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
43 std::string serverIdentifier_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
44 bool open_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
45 unsigned int databaseVersion_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
46 IDatabaseWrapper::Capabilities dbCapabilities_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
47
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
48 void CheckSuccess(OrthancPluginErrorCode code) const;
5207
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 public:
5811
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
51 OrthancPluginDatabaseV4(SharedLibrary& library,
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
52 PluginsErrorDictionary& errorDictionary,
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
53 const _OrthancPluginRegisterDatabaseBackendV4& database,
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
54 const std::string& serverIdentifier);
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
55
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
56 virtual ~OrthancPluginDatabaseV4();
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
57
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
58 const _OrthancPluginRegisterDatabaseBackendV4& GetDefinition() const
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
59 {
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
60 return definition_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
61 }
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
62
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
63 PluginsErrorDictionary& GetErrorDictionary() const
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
64 {
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
65 return errorDictionary_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
66 }
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
67
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
68 const std::string& GetServerIdentifier() const
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
69 {
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
70 return serverIdentifier_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
71 }
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
72
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
73 virtual void Open() ORTHANC_OVERRIDE;
5207
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
5811
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
75 virtual void Close() ORTHANC_OVERRIDE;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
76
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
77 const SharedLibrary& GetSharedLibrary() const
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
78 {
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
79 return library_;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
80 }
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
81
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
82 virtual void FlushToDisk() ORTHANC_OVERRIDE;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
83
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
84 virtual IDatabaseWrapper::ITransaction* StartTransaction(TransactionType type,
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
85 IDatabaseListener& listener)
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
86 ORTHANC_OVERRIDE;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
87
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
88 virtual unsigned int GetDatabaseVersion() ORTHANC_OVERRIDE;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
89
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
90 virtual void Upgrade(unsigned int targetVersion,
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
91 IStorageArea& storageArea) ORTHANC_OVERRIDE;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
92
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
93 virtual uint64_t MeasureLatency() ORTHANC_OVERRIDE;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
94
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
95 virtual const Capabilities GetDatabaseCapabilities() const ORTHANC_OVERRIDE;
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
96
a451777236fb advanced storage: fix + customizable path
Alain Mazy <am@orthanc.team>
parents: 5810
diff changeset
97 virtual bool HasIntegratedFind() const ORTHANC_OVERRIDE;
5207
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 };
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 }
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100
e7529e6241d2 first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 #endif