annotate OrthancServer/Sources/Database/BaseDatabaseWrapper.h @ 5852:ea547160f27e find-refactoring

StatelessDatabaseOperations: reimplementing LookupAttachment()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 29 Oct 2024 15:57:53 +0000
parents 70a879a7b658
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5455
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
1 /**
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
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: 5518
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: 5518
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5498
c5a274851b23 update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5466
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
5455
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
8 *
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
12 * License, or (at your option) any later version.
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
13 *
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
17 * General Public License for more details.
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
18 *
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
21 **/
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
22
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
23
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
24 #pragma once
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
25
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
26 #include "IDatabaseWrapper.h"
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
27
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
28 namespace Orthanc
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
29 {
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
30 /**
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
31 * This class provides a default "not implemented" implementation
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
32 * for all recent methods (1.12.X)
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
33 **/
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
34 class BaseDatabaseWrapper : public IDatabaseWrapper
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
35 {
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
36 public:
5847
70a879a7b658 introduction of IDatabaseWrapper::ICompatibilityTransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5837
diff changeset
37 class BaseTransaction :
70a879a7b658 introduction of IDatabaseWrapper::ICompatibilityTransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5837
diff changeset
38 public IDatabaseWrapper::ITransaction,
70a879a7b658 introduction of IDatabaseWrapper::ICompatibilityTransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5837
diff changeset
39 public IDatabaseWrapper::ICompatibilityTransaction
5455
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
40 {
5516
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5498
diff changeset
41 public:
5455
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
42 virtual int64_t IncrementGlobalProperty(GlobalProperty property,
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
43 int64_t increment,
5516
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5498
diff changeset
44 bool shared) ORTHANC_OVERRIDE;
5466
dceed5e3d6a9 new DB plugin primitive: UpdateAndGetStatistics
Alain Mazy <am@osimis.io>
parents: 5455
diff changeset
45
dceed5e3d6a9 new DB plugin primitive: UpdateAndGetStatistics
Alain Mazy <am@osimis.io>
parents: 5455
diff changeset
46 virtual void UpdateAndGetStatistics(int64_t& patientsCount,
dceed5e3d6a9 new DB plugin primitive: UpdateAndGetStatistics
Alain Mazy <am@osimis.io>
parents: 5455
diff changeset
47 int64_t& studiesCount,
dceed5e3d6a9 new DB plugin primitive: UpdateAndGetStatistics
Alain Mazy <am@osimis.io>
parents: 5455
diff changeset
48 int64_t& seriesCount,
dceed5e3d6a9 new DB plugin primitive: UpdateAndGetStatistics
Alain Mazy <am@osimis.io>
parents: 5455
diff changeset
49 int64_t& instancesCount,
dceed5e3d6a9 new DB plugin primitive: UpdateAndGetStatistics
Alain Mazy <am@osimis.io>
parents: 5455
diff changeset
50 int64_t& compressedSize,
5516
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5498
diff changeset
51 int64_t& uncompressedSize) ORTHANC_OVERRIDE;
5593
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
52
5837
82fc95cc168c /tools/count-resources
Alain Mazy <am@orthanc.team>
parents: 5804
diff changeset
53 virtual void ExecuteCount(uint64_t& count,
82fc95cc168c /tools/count-resources
Alain Mazy <am@orthanc.team>
parents: 5804
diff changeset
54 const FindRequest& request,
82fc95cc168c /tools/count-resources
Alain Mazy <am@orthanc.team>
parents: 5804
diff changeset
55 const Capabilities& capabilities) ORTHANC_OVERRIDE;
82fc95cc168c /tools/count-resources
Alain Mazy <am@orthanc.team>
parents: 5804
diff changeset
56
5593
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
57 virtual void ExecuteFind(FindResponse& response,
5677
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
58 const FindRequest& request,
dc96401dbe88 starting the refactoring of /tools/find
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5641
diff changeset
59 const Capabilities& capabilities) ORTHANC_OVERRIDE;
5593
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
60
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
61 virtual void ExecuteFind(std::list<std::string>& identifiers,
5720
89d559e67b03 fix compatibility with old database plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
62 const Capabilities& capabilities,
89d559e67b03 fix compatibility with old database plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
63 const FindRequest& request) ORTHANC_OVERRIDE;
5593
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
64
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
65 virtual void ExecuteExpand(FindResponse& response,
5720
89d559e67b03 fix compatibility with old database plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5677
diff changeset
66 const Capabilities& capabilities,
5593
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
67 const FindRequest& request,
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
68 const std::string& identifier) ORTHANC_OVERRIDE;
5758
ca06dde85358 merged find-refactoring -> large-queries
Alain Mazy <am@orthanc.team>
parents: 5757 5720
diff changeset
69
5757
5463c3ae3235 refactored extended /changes
Alain Mazy <am@orthanc.team>
parents: 5663
diff changeset
70 virtual void GetChangesExtended(std::list<ServerIndexChange>& target /*out*/,
5463c3ae3235 refactored extended /changes
Alain Mazy <am@orthanc.team>
parents: 5663
diff changeset
71 bool& done /*out*/,
5463c3ae3235 refactored extended /changes
Alain Mazy <am@orthanc.team>
parents: 5663
diff changeset
72 int64_t since,
5463c3ae3235 refactored extended /changes
Alain Mazy <am@orthanc.team>
parents: 5663
diff changeset
73 int64_t to,
5463c3ae3235 refactored extended /changes
Alain Mazy <am@orthanc.team>
parents: 5663
diff changeset
74 uint32_t limit,
5804
25df40a274fd /changes: allowing filtering on multiple changes
Alain Mazy <am@orthanc.team>
parents: 5758
diff changeset
75 const std::set<ChangeType>& filterType) ORTHANC_OVERRIDE;
5455
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
76 };
5518
bbe45a71f5cd reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5516
diff changeset
77
bbe45a71f5cd reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5516
diff changeset
78 virtual uint64_t MeasureLatency() ORTHANC_OVERRIDE;
5593
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
79
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
80 virtual bool HasIntegratedFind() const ORTHANC_OVERRIDE
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
81 {
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
82 return false;
862b54b4cfe2 implemented the default multi-stage find/expand
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5518
diff changeset
83 }
5455
176bc05f85f4 DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
diff changeset
84 };
5516
d9c9f3c57f4f reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5498
diff changeset
85 }