Mercurial > hg > orthanc-stone
annotate Framework/Oracle/GenericOracleRunner.h @ 1313:f30905f5d246 broker
Added support for OnGenericSdlEvent to GuiAdapter.
This makes it possible to piggyback app-specific logic
to special events (here, to support the Viewport refresh
events)
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 16 Mar 2020 11:12:39 +0100 |
parents | 0ca50d275b9a |
children | 30deba7bc8e2 |
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 | |
1271
0ca50d275b9a
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1150
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
1077 | 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 #pragma once | |
23 | |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
24 #if !defined(ORTHANC_ENABLE_DCMTK) |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
25 # 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
|
26 #endif |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
27 |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
28 #if ORTHANC_ENABLE_DCMTK == 1 |
1150 | 29 # include "../Toolbox/ParsedDicomCache.h" |
1124
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 |
1129
c3d4adf8bc70
removing IOracleRunner abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1127
diff
changeset
|
32 #include "IOracleCommand.h" |
1134
87fbeb823375
allocating messages from oracle commands on the stack
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1129
diff
changeset
|
33 #include "../Messages/IMessageEmitter.h" |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
34 |
1077 | 35 #include <Core/Enumerations.h> // For ORTHANC_OVERRIDE |
36 #include <Core/WebServiceParameters.h> | |
37 | |
38 namespace OrthancStone | |
39 { | |
1129
c3d4adf8bc70
removing IOracleRunner abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1127
diff
changeset
|
40 class GenericOracleRunner : public boost::noncopyable |
1077 | 41 { |
42 private: | |
1104 | 43 Orthanc::WebServiceParameters orthanc_; |
44 std::string rootDirectory_; | |
1077 | 45 |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
46 #if ORTHANC_ENABLE_DCMTK == 1 |
1150 | 47 boost::shared_ptr<ParsedDicomCache> dicomCache_; |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
48 #endif |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
49 |
1077 | 50 public: |
1127 | 51 GenericOracleRunner() : |
52 rootDirectory_(".") | |
1104 | 53 { |
54 } | |
55 | |
56 void SetOrthanc(const Orthanc::WebServiceParameters& orthanc) | |
57 { | |
58 orthanc_ = orthanc; | |
59 } | |
60 | |
61 const Orthanc::WebServiceParameters& GetOrthanc() const | |
1077 | 62 { |
1104 | 63 return orthanc_; |
64 } | |
65 | |
66 void SetRootDirectory(const std::string& rootDirectory) | |
67 { | |
68 rootDirectory_ = rootDirectory; | |
69 } | |
70 | |
71 const std::string GetRootDirectory() const | |
72 { | |
73 return rootDirectory_; | |
1077 | 74 } |
75 | |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
76 #if ORTHANC_ENABLE_DCMTK == 1 |
1150 | 77 void SetDicomCache(boost::shared_ptr<ParsedDicomCache> cache) |
1124
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
78 { |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
79 dicomCache_ = cache; |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
80 } |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
81 #endif |
a8bf81756839
unsuccessful attempt to cache ParseDicomFileCommand
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1104
diff
changeset
|
82 |
1134
87fbeb823375
allocating messages from oracle commands on the stack
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1129
diff
changeset
|
83 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
|
84 IMessageEmitter& emitter, |
1135
a0a33e5ea5bb
IOracleCommand::Clone()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1134
diff
changeset
|
85 const IOracleCommand& command); |
1077 | 86 }; |
87 } |