annotate Framework/Plugins/DatabaseBackendAdapterV2.h @ 380:cb91096fef06 db-protobuf

implemented full protobuf api
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 Mar 2023 17:08:00 +0200
parents 16aac0287485
children 3d6886f3e5b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
359
16aac0287485 copyright upgraded to 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
16aac0287485 copyright upgraded to 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 224
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * modify it under the terms of the GNU Affero General Public License
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * Affero General Public License for more details.
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU Affero General Public License
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 /**
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * NOTE: Until Orthanc 1.4.0, this file was part of the Orthanc source
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * distribution. This file is now part of "orthanc-databases", in
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * order to uncouple its evolution from the Orthanc core.
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 **/
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #pragma once
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
202
2def2df94f94 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 201
diff changeset
32 #include "IDatabaseBackend.h"
152
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
33
204
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
34
203
2089d4071408 moving classes out of OrthancPlugins namespace, to OrthancDatabases
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 202
diff changeset
35 namespace OrthancDatabases
204
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
36 {
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 /**
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 * @brief Bridge between C and C++ database engines.
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 *
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 * Class creating the bridge between the C low-level primitives for
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 * custom database engines, and the high-level IDatabaseBackend C++
204
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
42 * interface, for Orthanc <= 1.9.1.
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 *
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 * @ingroup Callbacks
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 **/
200
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
46 class DatabaseBackendAdapterV2
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 {
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 private:
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 // This class cannot be instantiated
200
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 199
diff changeset
50 DatabaseBackendAdapterV2()
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 {
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
205
873e37048f96 renaming OrthancCppDatabasePlugin.h as DatabaseBackendAdapterV2.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
54 public:
224
61c309e06797 added internal class DatabaseBackendAdapterV2::Adapter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 222
diff changeset
55 class Adapter;
205
873e37048f96 renaming OrthancCppDatabasePlugin.h as DatabaseBackendAdapterV2.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
56 class Output;
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
204
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
58 class Factory : public IDatabaseBackendOutput::IFactory
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
59 {
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
60 private:
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
61 OrthancPluginContext* context_;
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
62 OrthancPluginDatabaseContext* database_;
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
63
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
64 public:
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
65 Factory(OrthancPluginContext* context,
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
66 OrthancPluginDatabaseContext* database) :
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
67 context_(context),
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
68 database_(database)
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
69 {
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
70 }
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
71
205
873e37048f96 renaming OrthancCppDatabasePlugin.h as DatabaseBackendAdapterV2.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 204
diff changeset
72 virtual IDatabaseBackendOutput* CreateOutput() ORTHANC_OVERRIDE;
204
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
73 };
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
74
222
c8e06b41feec refactoring registration/finalization of index backend
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 207
diff changeset
75 static void Register(IDatabaseBackend* backend);
204
7299410c3d61 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 203
diff changeset
76
222
c8e06b41feec refactoring registration/finalization of index backend
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 207
diff changeset
77 static void Finalize();
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 };
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 }