comparison OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.h @ 5083:75e949689c08 attach-custom-data

PluginDatabaseV4 to handle customData
author Alain Mazy <am@osimis.io>
date Wed, 14 Sep 2022 17:11:45 +0200
parents
children 8279eaab0d1d
comparison
equal deleted inserted replaced
5082:4af5f496a0dd 5083:75e949689c08
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * 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 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 **/
21
22
23 #pragma once
24
25 #if ORTHANC_ENABLE_PLUGINS == 1
26
27 #include "../../../OrthancFramework/Sources/SharedLibrary.h"
28 #include "../../Sources/Database/IDatabaseWrapper.h"
29 #include "../Include/orthanc/OrthancCDatabasePlugin.h"
30 #include "PluginsErrorDictionary.h"
31
32 namespace Orthanc
33 {
34 class OrthancPluginDatabaseV4 : public IDatabaseWrapper
35 {
36 private:
37 class Transaction;
38
39 SharedLibrary& library_;
40 PluginsErrorDictionary& errorDictionary_;
41 OrthancPluginDatabaseBackendV4 backend_;
42 void* database_;
43 std::string serverIdentifier_;
44
45 void CheckSuccess(OrthancPluginErrorCode code) const;
46
47 public:
48 OrthancPluginDatabaseV4(SharedLibrary& library,
49 PluginsErrorDictionary& errorDictionary,
50 const OrthancPluginDatabaseBackendV4* backend,
51 size_t backendSize,
52 void* database,
53 const std::string& serverIdentifier);
54
55 virtual ~OrthancPluginDatabaseV4();
56
57 virtual void Open() ORTHANC_OVERRIDE;
58
59 virtual void Close() ORTHANC_OVERRIDE;
60
61 const SharedLibrary& GetSharedLibrary() const
62 {
63 return library_;
64 }
65
66 virtual void FlushToDisk() ORTHANC_OVERRIDE
67 {
68 }
69
70 virtual bool HasFlushToDisk() const ORTHANC_OVERRIDE
71 {
72 return false;
73 }
74
75 virtual IDatabaseWrapper::ITransaction* StartTransaction(TransactionType type,
76 IDatabaseListener& listener)
77 ORTHANC_OVERRIDE;
78
79 virtual unsigned int GetDatabaseVersion() ORTHANC_OVERRIDE;
80
81 virtual void Upgrade(unsigned int targetVersion,
82 IStorageArea& storageArea) ORTHANC_OVERRIDE;
83
84 virtual bool HasRevisionsSupport() const ORTHANC_OVERRIDE;
85
86 virtual bool HasAttachmentCustomDataSupport() const ORTHANC_OVERRIDE;
87
88 };
89 }
90
91 #endif