Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.h @ 5807:8279eaab0d1d attach-custom-data
merged default -> attach-custom-data
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Tue, 24 Sep 2024 11:39:52 +0200 |
parents | 75e949689c08 f7adfb22e20e |
children | 023a99146dd0 |
comparison
equal
deleted
inserted
replaced
5085:79f98ee4f04b | 5807:8279eaab0d1d |
---|---|
1 /** | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
4 * Department, University Hospital of Liege, Belgium | 4 * Department, University Hospital of Liege, Belgium |
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium | 5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | 6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | |
7 * | 8 * |
8 * This program is free software: you can redistribute it and/or | 9 * This program is free software: you can redistribute it and/or |
9 * modify it under the terms of the GNU General Public License as | 10 * modify it under the terms of the GNU General Public License as |
10 * published by the Free Software Foundation, either version 3 of the | 11 * published by the Free Software Foundation, either version 3 of the |
11 * License, or (at your option) any later version. | 12 * License, or (at your option) any later version. |
24 | 25 |
25 #if ORTHANC_ENABLE_PLUGINS == 1 | 26 #if ORTHANC_ENABLE_PLUGINS == 1 |
26 | 27 |
27 #include "../../../OrthancFramework/Sources/SharedLibrary.h" | 28 #include "../../../OrthancFramework/Sources/SharedLibrary.h" |
28 #include "../../Sources/Database/IDatabaseWrapper.h" | 29 #include "../../Sources/Database/IDatabaseWrapper.h" |
29 #include "../Include/orthanc/OrthancCDatabasePlugin.h" | 30 #include "../Include/orthanc/OrthancCPlugin.h" |
30 #include "PluginsErrorDictionary.h" | 31 #include "PluginsErrorDictionary.h" |
31 | 32 |
32 namespace Orthanc | 33 namespace Orthanc |
33 { | 34 { |
34 class OrthancPluginDatabaseV4 : public IDatabaseWrapper | 35 class OrthancPluginDatabaseV4 : public IDatabaseWrapper |
35 { | 36 { |
36 private: | 37 private: |
37 class Transaction; | 38 class Transaction; |
38 | 39 |
39 SharedLibrary& library_; | 40 SharedLibrary& library_; |
40 PluginsErrorDictionary& errorDictionary_; | 41 PluginsErrorDictionary& errorDictionary_; |
41 OrthancPluginDatabaseBackendV4 backend_; | 42 _OrthancPluginRegisterDatabaseBackendV4 definition_; |
42 void* database_; | 43 std::string serverIdentifier_; |
43 std::string serverIdentifier_; | 44 bool open_; |
45 unsigned int databaseVersion_; | |
46 IDatabaseWrapper::Capabilities dbCapabilities_; | |
44 | 47 |
45 void CheckSuccess(OrthancPluginErrorCode code) const; | 48 void CheckSuccess(OrthancPluginErrorCode code) const; |
46 | 49 |
47 public: | 50 public: |
48 OrthancPluginDatabaseV4(SharedLibrary& library, | 51 OrthancPluginDatabaseV4(SharedLibrary& library, |
49 PluginsErrorDictionary& errorDictionary, | 52 PluginsErrorDictionary& errorDictionary, |
50 const OrthancPluginDatabaseBackendV4* backend, | 53 const _OrthancPluginRegisterDatabaseBackendV4& database, |
51 size_t backendSize, | |
52 void* database, | |
53 const std::string& serverIdentifier); | 54 const std::string& serverIdentifier); |
54 | 55 |
55 virtual ~OrthancPluginDatabaseV4(); | 56 virtual ~OrthancPluginDatabaseV4(); |
56 | 57 |
58 const _OrthancPluginRegisterDatabaseBackendV4& GetDefinition() const | |
59 { | |
60 return definition_; | |
61 } | |
62 | |
63 PluginsErrorDictionary& GetErrorDictionary() const | |
64 { | |
65 return errorDictionary_; | |
66 } | |
67 | |
68 const std::string& GetServerIdentifier() const | |
69 { | |
70 return serverIdentifier_; | |
71 } | |
72 | |
57 virtual void Open() ORTHANC_OVERRIDE; | 73 virtual void Open() ORTHANC_OVERRIDE; |
58 | 74 |
59 virtual void Close() ORTHANC_OVERRIDE; | 75 virtual void Close() ORTHANC_OVERRIDE; |
60 | 76 |
61 const SharedLibrary& GetSharedLibrary() const | 77 const SharedLibrary& GetSharedLibrary() const |
62 { | 78 { |
63 return library_; | 79 return library_; |
64 } | 80 } |
65 | 81 |
66 virtual void FlushToDisk() ORTHANC_OVERRIDE | 82 virtual void FlushToDisk() ORTHANC_OVERRIDE; |
67 { | |
68 } | |
69 | |
70 virtual bool HasFlushToDisk() const ORTHANC_OVERRIDE | |
71 { | |
72 return false; | |
73 } | |
74 | 83 |
75 virtual IDatabaseWrapper::ITransaction* StartTransaction(TransactionType type, | 84 virtual IDatabaseWrapper::ITransaction* StartTransaction(TransactionType type, |
76 IDatabaseListener& listener) | 85 IDatabaseListener& listener) |
77 ORTHANC_OVERRIDE; | 86 ORTHANC_OVERRIDE; |
78 | 87 |
79 virtual unsigned int GetDatabaseVersion() ORTHANC_OVERRIDE; | 88 virtual unsigned int GetDatabaseVersion() ORTHANC_OVERRIDE; |
80 | 89 |
81 virtual void Upgrade(unsigned int targetVersion, | 90 virtual void Upgrade(unsigned int targetVersion, |
82 IStorageArea& storageArea) ORTHANC_OVERRIDE; | 91 IStorageArea& storageArea) ORTHANC_OVERRIDE; |
83 | 92 |
84 virtual bool HasRevisionsSupport() const ORTHANC_OVERRIDE; | 93 virtual uint64_t MeasureLatency() ORTHANC_OVERRIDE; |
85 | 94 |
86 virtual bool HasAttachmentCustomDataSupport() const ORTHANC_OVERRIDE; | 95 virtual const Capabilities GetDatabaseCapabilities() const ORTHANC_OVERRIDE; |
87 | |
88 }; | 96 }; |
89 } | 97 } |
90 | 98 |
91 #endif | 99 #endif |