Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Oracle/GenericOracleRunner.h @ 1886:ca89fec8c48f
test
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 14 Jan 2022 19:10:30 +0100 |
parents | 7053b8a0aaec |
children | 07964689cb0b |
rev | line source |
---|---|
1077 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
1871
7053b8a0aaec
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1870
diff
changeset
|
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
7053b8a0aaec
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1870
diff
changeset
|
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1077 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public License |
1077 | 10 * as published by the Free Software Foundation, either version 3 of |
11 * the License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
16 * Lesser General Public License for more details. |
1596
4fb8fdf03314
removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1512
diff
changeset
|
17 * |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
19 * License along with this program. If not, see |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
20 * <http://www.gnu.org/licenses/>. |
1077 | 21 **/ |
22 | |
23 | |
24 #pragma once | |
25 | |
1509
b7210c688ca7
linking SDL samples against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1455
diff
changeset
|
26 #include <OrthancFramework.h> // To have the macros properly defined |
b7210c688ca7
linking SDL samples against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1455
diff
changeset
|
27 |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
28 #if !defined(ORTHANC_ENABLE_DCMTK) |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
29 # error The macro ORTHANC_ENABLE_DCMTK must be defined |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
30 #endif |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
31 |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
32 #if ORTHANC_ENABLE_DCMTK == 1 |
1150 | 33 # include "../Toolbox/ParsedDicomCache.h" |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
34 #endif |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
35 |
1129
c3d4adf8bc70
removing IOracleRunner abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1127
diff
changeset
|
36 #include "IOracleCommand.h" |
1134
87fbeb823375
allocating messages from oracle commands on the stack
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1129
diff
changeset
|
37 #include "../Messages/IMessageEmitter.h" |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
38 |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
39 #include <Enumerations.h> // For ORTHANC_OVERRIDE |
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1271
diff
changeset
|
40 #include <WebServiceParameters.h> |
1077 | 41 |
42 namespace OrthancStone | |
43 { | |
1129
c3d4adf8bc70
removing IOracleRunner abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1127
diff
changeset
|
44 class GenericOracleRunner : public boost::noncopyable |
1077 | 45 { |
46 private: | |
1104 | 47 Orthanc::WebServiceParameters orthanc_; |
48 std::string rootDirectory_; | |
1077 | 49 |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
50 #if ORTHANC_ENABLE_DCMTK == 1 |
1150 | 51 boost::shared_ptr<ParsedDicomCache> dicomCache_; |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
52 #endif |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
53 |
1077 | 54 public: |
1127 | 55 GenericOracleRunner() : |
56 rootDirectory_(".") | |
1104 | 57 { |
58 } | |
59 | |
60 void SetOrthanc(const Orthanc::WebServiceParameters& orthanc) | |
61 { | |
62 orthanc_ = orthanc; | |
63 } | |
64 | |
65 const Orthanc::WebServiceParameters& GetOrthanc() const | |
1077 | 66 { |
1104 | 67 return orthanc_; |
68 } | |
69 | |
70 void SetRootDirectory(const std::string& rootDirectory) | |
71 { | |
72 rootDirectory_ = rootDirectory; | |
73 } | |
74 | |
75 const std::string GetRootDirectory() const | |
76 { | |
77 return rootDirectory_; | |
1077 | 78 } |
79 | |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
80 #if ORTHANC_ENABLE_DCMTK == 1 |
1150 | 81 void SetDicomCache(boost::shared_ptr<ParsedDicomCache> cache) |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
82 { |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
83 dicomCache_ = cache; |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
84 } |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
85 #endif |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
86 |
1134
87fbeb823375
allocating messages from oracle commands on the stack
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1129
diff
changeset
|
87 void Run(boost::weak_ptr<IObserver> receiver, |
87fbeb823375
allocating messages from oracle commands on the stack
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1129
diff
changeset
|
88 IMessageEmitter& emitter, |
1135
a0a33e5ea5bb
IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1134
diff
changeset
|
89 const IOracleCommand& command); |
1077 | 90 }; |
91 } |