annotate Framework/Plugins/PluginInitialization.cpp @ 389:3d6886f3e5b3

upgrade to year 2023
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Apr 2023 11:17:20 +0200
parents 16aac0287485
children ecd0b719cff5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
389
3d6886f3e5b3 upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
3d6886f3e5b3 upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * modify it under the terms of the GNU Affero General Public License
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * Affero General Public License for more details.
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU Affero General Public License
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include "PluginInitialization.h"
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
25 #include "../Common/ImplicitTransaction.h"
152
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
26 #include "../../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h"
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
27
152
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
28 #include <Logging.h>
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
29 #include <Toolbox.h>
62
eedd082355f9 fix for compatibility with simplified OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
30
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 namespace OrthancDatabases
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
34 static bool DisplayPerformanceWarning(const std::string& dbms,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
35 bool isIndex)
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 {
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 (void) DisplayPerformanceWarning; // Disable warning about unused function
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
38 LOG(WARNING) << "Performance warning in " << dbms
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
39 << (isIndex ? " index" : " storage area")
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
40 << ": Non-release build, runtime debug assertions are turned on";
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 return true;
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 }
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 bool InitializePlugin(OrthancPluginContext* context,
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
46 const std::string& dbms,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
47 bool isIndex)
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
168
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 153
diff changeset
49 #if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 7, 2)
149
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
50 Orthanc::Logging::InitializePluginContext(context);
151
6c58af430ba0 improved Orthanc::Logging::Initialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
51 #else
6c58af430ba0 improved Orthanc::Logging::Initialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
52 Orthanc::Logging::Initialize(context);
6c58af430ba0 improved Orthanc::Logging::Initialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
53 #endif
260
793bbbe11287 IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 193
diff changeset
54
793bbbe11287 IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 193
diff changeset
55 Orthanc::Logging::EnableInfoLevel(true);
62
eedd082355f9 fix for compatibility with simplified OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
56 OrthancPlugins::SetGlobalContext(context);
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
57 ImplicitTransaction::SetErrorOnDoubleExecution(false);
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
59 assert(DisplayPerformanceWarning(dbms, isIndex));
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 /* Check the version of the Orthanc core */
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 bool useFallback = true;
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
64 bool isOptimal = false;
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) // Macro introduced in Orthanc 1.3.1
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 4, 0)
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 if (OrthancPluginCheckVersionAdvanced(context, 0, 9, 5) == 0)
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 {
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 LOG(ERROR) << "Your version of Orthanc (" << context->orthancVersion
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 << ") must be above 0.9.5 to run this plugin";
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 return false;
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 }
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
75 if (OrthancPluginCheckVersionAdvanced(context, 1, 4, 0) == 1)
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
76 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
77 ImplicitTransaction::SetErrorOnDoubleExecution(true);
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
78 }
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
79
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
80 if (OrthancPluginCheckVersionAdvanced(context,
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
81 ORTHANC_OPTIMAL_VERSION_MAJOR,
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
82 ORTHANC_OPTIMAL_VERSION_MINOR,
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
83 ORTHANC_OPTIMAL_VERSION_REVISION) == 1)
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
84 {
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
85 isOptimal = true;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
86 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
87
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 useFallback = false;
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 # endif
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 #endif
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 if (useFallback &&
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 OrthancPluginCheckVersion(context) == 0)
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 {
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 LOG(ERROR) << "Your version of Orthanc ("
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 << context->orthancVersion << ") must be above "
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 << ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER << "."
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 << ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER << "."
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 << ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 << " to run this plugin";
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 return false;
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 }
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
64
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
104 if (useFallback)
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
105 {
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
106 std::string v(context->orthancVersion);
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
107
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
108 if (v == "mainline")
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
109 {
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
110 isOptimal = true;
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
111 }
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
112 else
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
113 {
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
114 std::vector<std::string> tokens;
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
115 Orthanc::Toolbox::TokenizeString(tokens, v, '.');
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
116
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
117 if (tokens.size() != 3)
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
118 {
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
119 LOG(ERROR) << "Bad version of Orthanc: " << v;
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
120 return false;
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
121 }
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
122
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
123 int major = boost::lexical_cast<int>(tokens[0]);
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
124 int minor = boost::lexical_cast<int>(tokens[1]);
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
125 int revision = boost::lexical_cast<int>(tokens[2]);
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
126
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
127 isOptimal = (major > ORTHANC_OPTIMAL_VERSION_MAJOR ||
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
128 (major == ORTHANC_OPTIMAL_VERSION_MAJOR &&
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
129 minor > ORTHANC_OPTIMAL_VERSION_MINOR) ||
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
130 (major == ORTHANC_OPTIMAL_VERSION_MAJOR &&
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
131 minor == ORTHANC_OPTIMAL_VERSION_MINOR &&
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
132 revision >= ORTHANC_OPTIMAL_VERSION_REVISION));
64
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
133 }
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
134 }
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
135
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
136 if (!isOptimal &&
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
137 isIndex)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
138 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
139 LOG(WARNING) << "Performance warning in " << dbms
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
140 << " index: Your version of Orthanc ("
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
141 << context->orthancVersion << ") should be upgraded to "
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
142 << ORTHANC_OPTIMAL_VERSION_MAJOR << "."
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
143 << ORTHANC_OPTIMAL_VERSION_MINOR << "."
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
144 << ORTHANC_OPTIMAL_VERSION_REVISION
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
145 << " to benefit from best performance";
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
146 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
147
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
148
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
149 std::string description = ("Stores the Orthanc " +
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
150 std::string(isIndex ? "index" : "storage area") +
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
151 " into a " + dbms + " database");
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
152
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 OrthancPluginSetDescription(context, description.c_str());
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 return true;
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 }
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 }