Mercurial > hg > orthanc-databases
annotate Framework/Plugins/StorageBackend.h @ 242:b97a537f4613
MySQL: Support of range reads for the storage area
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 13 Apr 2021 17:00:02 +0200 |
parents | 0a9b48d19643 |
children | 483af3f35a4b |
rev | line source |
---|---|
1
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
193
3236894320d6
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
186
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
1
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Affero General Public License |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * the License, or (at your option) any later version. |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * Affero General Public License for more details. |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Affero General Public License |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 **/ |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 #pragma once |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #include "../Common/DatabaseManager.h" |
194
a51ce147dbe0
refactoring using new class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
193
diff
changeset
|
25 |
1
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 #include <orthanc/OrthancCDatabasePlugin.h> |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
231
0a9b48d19643
removed mutex out of DatabaseManager
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
230
diff
changeset
|
28 #include <boost/thread/mutex.hpp> |
0a9b48d19643
removed mutex out of DatabaseManager
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
230
diff
changeset
|
29 |
1
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 namespace OrthancDatabases |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 { |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 class StorageBackend : public boost::noncopyable |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 { |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 public: |
219
dd6cfc250747
removed useless class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
36 class IFileContentVisitor : public boost::noncopyable |
dd6cfc250747
removed useless class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
37 { |
dd6cfc250747
removed useless class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
38 public: |
dd6cfc250747
removed useless class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
39 virtual ~IFileContentVisitor() |
dd6cfc250747
removed useless class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
40 { |
dd6cfc250747
removed useless class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
41 } |
dd6cfc250747
removed useless class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
42 |
dd6cfc250747
removed useless class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
43 virtual void Assign(const std::string& content) = 0; |
230
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
44 |
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
45 virtual bool IsSuccess() const = 0; |
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
46 }; |
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
47 |
242
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
48 class IAccessor : public boost::noncopyable |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
49 { |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
50 public: |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
51 virtual ~IAccessor() |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
52 { |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
53 } |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
54 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
55 virtual void Create(const std::string& uuid, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
56 const void* content, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
57 size_t size, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
58 OrthancPluginContentType type) = 0; |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
59 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
60 virtual void ReadWhole(IFileContentVisitor& visitor, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
61 const std::string& uuid, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
62 OrthancPluginContentType type) = 0; |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
63 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
64 virtual void ReadRange(IFileContentVisitor& visitor, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
65 const std::string& uuid, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
66 OrthancPluginContentType type, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
67 uint64_t start, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
68 uint64_t length) = 0; |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
69 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
70 virtual void Remove(const std::string& uuid, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
71 OrthancPluginContentType type) = 0; |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
72 }; |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
73 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
74 private: |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
75 class StringVisitor; |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
76 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
77 boost::mutex mutex_; |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
78 std::unique_ptr<DatabaseManager> manager_; |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
79 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
80 DatabaseManager& GetManager(); |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
81 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
82 protected: |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
83 class AccessorBase : public IAccessor |
230
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
84 { |
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
85 private: |
231
0a9b48d19643
removed mutex out of DatabaseManager
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
230
diff
changeset
|
86 boost::mutex::scoped_lock lock_; |
0a9b48d19643
removed mutex out of DatabaseManager
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
230
diff
changeset
|
87 DatabaseManager& manager_; |
230
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
88 |
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
89 public: |
242
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
90 AccessorBase(StorageBackend& backend) : |
231
0a9b48d19643
removed mutex out of DatabaseManager
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
230
diff
changeset
|
91 lock_(backend.mutex_), |
230
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
92 manager_(backend.GetManager()) |
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
93 { |
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
94 } |
242
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
95 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
96 DatabaseManager& GetManager() const |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
97 { |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
98 return manager_; |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
99 } |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
100 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
101 virtual void Create(const std::string& uuid, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
102 const void* content, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
103 size_t size, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
104 OrthancPluginContentType type); |
230
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
105 |
242
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
106 virtual void ReadWhole(IFileContentVisitor& visitor, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
107 const std::string& uuid, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
108 OrthancPluginContentType type); |
230
675f8322eb7c
refactored StorageBackend by introducing an accessor class
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
109 |
242
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
110 virtual void ReadRange(IFileContentVisitor& visitor, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
111 const std::string& uuid, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
112 OrthancPluginContentType type, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
113 uint64_t start, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
114 uint64_t length); |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
115 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
116 virtual void Remove(const std::string& uuid, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
117 OrthancPluginContentType type); |
219
dd6cfc250747
removed useless class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
118 }; |
dd6cfc250747
removed useless class StorageAreaBuffer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
119 |
242
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
120 void SetDatabase(IDatabase* database); // Takes ownership |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
121 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
122 virtual bool HasReadRange() const = 0; |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
123 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
124 public: |
1
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 virtual ~StorageBackend() |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 { |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 } |
12
41543239072d
transactions for storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
128 |
242
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
129 virtual IAccessor* CreateAccessor() |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
130 { |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
131 return new AccessorBase(*this); |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
132 } |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
133 |
1
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 static void Register(OrthancPluginContext* context, |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 StorageBackend* backend); // Takes ownership |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 static void Finalize(); |
242
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
138 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
139 // For unit tests |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
140 static void ReadWholeToString(std::string& target, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
141 IAccessor& accessor, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
142 const std::string& uuid, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
143 OrthancPluginContentType type); |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
144 |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
145 // For unit tests |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
146 static void ReadRangeToString(std::string& target, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
147 IAccessor& accessor, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
148 const std::string& uuid, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
149 OrthancPluginContentType type, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
150 uint64_t start, |
b97a537f4613
MySQL: Support of range reads for the storage area
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
231
diff
changeset
|
151 uint64_t length); |
1
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 }; |
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 } |