Mercurial > hg > orthanc-databases
comparison Framework/Plugins/DatabaseBackendAdapterV2.h @ 205:873e37048f96
renaming OrthancCppDatabasePlugin.h as DatabaseBackendAdapterV2.h
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 18 Mar 2021 18:32:05 +0100 |
parents | Framework/Plugins/OrthancCppDatabasePlugin.h@7299410c3d61 |
children | d9ef3f16e6a2 |
comparison
equal
deleted
inserted
replaced
204:7299410c3d61 | 205:873e37048f96 |
---|---|
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-2021 Osimis S.A., Belgium | |
6 * | |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 | |
23 /** | |
24 * NOTE: Until Orthanc 1.4.0, this file was part of the Orthanc source | |
25 * distribution. This file is now part of "orthanc-databases", in | |
26 * order to uncouple its evolution from the Orthanc core. | |
27 **/ | |
28 | |
29 #pragma once | |
30 | |
31 #include "IDatabaseBackend.h" | |
32 | |
33 | |
34 namespace OrthancDatabases | |
35 { | |
36 /** | |
37 * @brief Bridge between C and C++ database engines. | |
38 * | |
39 * Class creating the bridge between the C low-level primitives for | |
40 * custom database engines, and the high-level IDatabaseBackend C++ | |
41 * interface, for Orthanc <= 1.9.1. | |
42 * | |
43 * @ingroup Callbacks | |
44 **/ | |
45 class DatabaseBackendAdapterV2 | |
46 { | |
47 private: | |
48 // This class cannot be instantiated | |
49 DatabaseBackendAdapterV2() | |
50 { | |
51 } | |
52 | |
53 public: | |
54 class Output; | |
55 | |
56 class Factory : public IDatabaseBackendOutput::IFactory | |
57 { | |
58 private: | |
59 OrthancPluginContext* context_; | |
60 OrthancPluginDatabaseContext* database_; | |
61 | |
62 public: | |
63 Factory(OrthancPluginContext* context, | |
64 OrthancPluginDatabaseContext* database) : | |
65 context_(context), | |
66 database_(database) | |
67 { | |
68 } | |
69 | |
70 virtual IDatabaseBackendOutput* CreateOutput() ORTHANC_OVERRIDE; | |
71 }; | |
72 | |
73 | |
74 /** | |
75 * Register a custom database back-end written in C++. | |
76 * | |
77 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
78 * @param backend Your custom database engine. | |
79 **/ | |
80 | |
81 static void Register(OrthancPluginContext* context, | |
82 IDatabaseBackend& backend); | |
83 }; | |
84 } |