Mercurial > hg > orthanc
annotate OrthancFramework/Sources/OrthancFramework.h @ 5342:65d55cc86a41
clarified error message
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 28 Jun 2023 11:54:41 +0200 |
parents | 0ea402b4d901 |
children | 48b8dae6dc77 |
rev | line source |
---|---|
3988
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
5185
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
3988
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * This program is free software: you can redistribute it and/or |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public License |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
10 * as published by the Free Software Foundation, either version 3 of |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
11 * the License, or (at your option) any later version. |
3988
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, but |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
16 * Lesser General Public License for more details. |
3988
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
19 * License along with this program. If not, see |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
20 * <http://www.gnu.org/licenses/>. |
3988
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 **/ |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #pragma once |
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
3992
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
26 /** |
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
27 * Besides the "pragma once" above that only protects this file, |
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
28 * define a macro to prevent including different versions of |
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
29 * "OrthancFramework.h" |
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
30 **/ |
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
31 #ifndef __ORTHANC_FRAMEWORK_H |
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
32 #define __ORTHANC_FRAMEWORK_H |
3991
5d2348b39392
turning toolbox namespaces into classes to control visibility in shared libraries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3990
diff
changeset
|
33 |
4026
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
34 #if !defined(ORTHANC_BUILDING_FRAMEWORK_LIBRARY) |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
35 # error The macro ORTHANC_BUILDING_FRAMEWORK_LIBRARY must be defined |
3996
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
36 #endif |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
37 |
3992
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
38 /** |
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
39 * It is implied that if this file is used, we're building the Orthanc |
3996
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
40 * framework (not using it as a shared library): We don't use the |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
41 * common "BUILDING_DLL" |
3992
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
42 * construction. https://gcc.gnu.org/wiki/Visibility |
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
43 **/ |
4026
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
44 #if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 |
3996
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
45 # if defined(_WIN32) || defined (__CYGWIN__) |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
46 # define ORTHANC_PUBLIC __declspec(dllexport) |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
47 # define ORTHANC_LOCAL |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
48 # else |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
49 # if __GNUC__ >= 4 |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
50 # define ORTHANC_PUBLIC __attribute__((visibility ("default"))) |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
51 # define ORTHANC_LOCAL __attribute__((visibility ("hidden"))) |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
52 # else |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
53 # define ORTHANC_PUBLIC |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
54 # define ORTHANC_LOCAL |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
55 # pragma warning Unknown dynamic link import/export semantics |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
56 # endif |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
57 # endif |
3988
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 #else |
3996
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
59 # define ORTHANC_PUBLIC |
c2b9a7a1c74a
ORTHANC_FRAMEWORK_BUILDING_PLUGIN
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3992
diff
changeset
|
60 # define ORTHANC_LOCAL |
3988
bdd8f952dd47
playing with visibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 #endif |
3990
226ab94a33cd
disabling test for exporting symbols
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3988
diff
changeset
|
62 |
4026
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
63 |
4141
99927401587c
define ORTHANC_FRAMEWORK_VERSION_IS_ABOVE even if Orthanc framework is statically linked
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
64 #define ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(major, minor, revision) \ |
99927401587c
define ORTHANC_FRAMEWORK_VERSION_IS_ABOVE even if Orthanc framework is statically linked
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
65 (ORTHANC_VERSION_MAJOR > major || \ |
99927401587c
define ORTHANC_FRAMEWORK_VERSION_IS_ABOVE even if Orthanc framework is statically linked
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
66 (ORTHANC_VERSION_MAJOR == major && \ |
99927401587c
define ORTHANC_FRAMEWORK_VERSION_IS_ABOVE even if Orthanc framework is statically linked
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
67 (ORTHANC_VERSION_MINOR > minor || \ |
99927401587c
define ORTHANC_FRAMEWORK_VERSION_IS_ABOVE even if Orthanc framework is statically linked
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
68 (ORTHANC_VERSION_MINOR == minor && \ |
99927401587c
define ORTHANC_FRAMEWORK_VERSION_IS_ABOVE even if Orthanc framework is statically linked
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
69 ORTHANC_VERSION_REVISION >= revision)))) |
99927401587c
define ORTHANC_FRAMEWORK_VERSION_IS_ABOVE even if Orthanc framework is statically linked
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
70 |
99927401587c
define ORTHANC_FRAMEWORK_VERSION_IS_ABOVE even if Orthanc framework is statically linked
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
71 |
4026
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
72 #include <string> |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
73 |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
74 namespace Orthanc |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
75 { |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
76 ORTHANC_PUBLIC void InitializeFramework(const std::string& locale, |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
77 bool loadPrivateDictionary); |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
78 |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
79 ORTHANC_PUBLIC void FinalizeFramework(); |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
80 } |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
81 |
05a363186da6
ORTHANC_BUILDING_FRAMEWORK_LIBRARY, Orthanc::InitializeFramework()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4000
diff
changeset
|
82 |
3992
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3991
diff
changeset
|
83 #endif /* __ORTHANC_FRAMEWORK_H */ |