Mercurial > hg > orthanc
annotate OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.h @ 5363:3c8286e5d07b multiple-jpeg-decoders
wip: try to add a jpeg decoder without colorspace conversion: not working now
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 11 Jul 2023 10:25:58 +0200 |
parents | b5c502bcaf99 |
children | 48b8dae6dc77 |
rev | line source |
---|---|
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
1 /** |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
5185
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5145
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5145
diff
changeset
|
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
7 * |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
8 * This program is free software: you can redistribute it and/or |
5277 | 9 * modify it under the terms of the GNU General Public License as |
10 * published by the Free Software Foundation, either version 3 of the | |
11 * License, or (at your option) any later version. | |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
12 * |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, but |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
5277 | 16 * General Public License for more details. |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
17 * |
5277 | 18 * You should have received a copy of the GNU General Public License |
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
20 **/ |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
21 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
22 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
23 #pragma once |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
24 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
25 #include "../../../OrthancFramework/Sources/Compatibility.h" // For ORTHANC_OVERRIDE |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
26 #include "../../../OrthancFramework/Sources/JobsEngine/IJob.h" |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
27 #include "../../../OrthancFramework/Sources/MultiThreading/SharedMessageQueue.h" |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
28 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
29 #include <set> |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
30 #include <boost/thread/recursive_mutex.hpp> |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
31 #include <boost/thread.hpp> |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
32 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
33 namespace Orthanc |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
34 { |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
35 class ServerContext; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
36 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
37 // This class is a threaded version of SetOfInstancesJob merged with CleaningInstancesJob |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
38 class ORTHANC_PUBLIC ThreadedSetOfInstancesJob : public IJob |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
39 { |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
40 public: |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
41 enum ThreadedJobStep // cannot use "Step" since there is a method with this name ! |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
42 { |
5145
df040c83796c
correctly report ThreadedSetOfInstancesJob progress
Alain Mazy <am@osimis.io>
parents:
5137
diff
changeset
|
43 ThreadedJobStep_NotStarted, |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
44 ThreadedJobStep_ProcessingInstances, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
45 ThreadedJobStep_PostProcessingInstances, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
46 ThreadedJobStep_Cleanup, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
47 ThreadedJobStep_Done |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
48 }; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
49 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
50 private: |
5136
e71b22a43c0b
Threaded modifications continued: call ReconstructInstance at the end of the modification to update the DB model
Alain Mazy <am@osimis.io>
parents:
5134
diff
changeset
|
51 std::set<std::string> instancesToProcess_; // the list of source instances ids to process |
e71b22a43c0b
Threaded modifications continued: call ReconstructInstance at the end of the modification to update the DB model
Alain Mazy <am@osimis.io>
parents:
5134
diff
changeset
|
52 std::set<std::string> failedInstances_; // the list of source instances ids that failed processing |
e71b22a43c0b
Threaded modifications continued: call ReconstructInstance at the end of the modification to update the DB model
Alain Mazy <am@osimis.io>
parents:
5134
diff
changeset
|
53 std::set<std::string> processedInstances_; // the list of source instances ids that have been processed (including failed ones) |
e71b22a43c0b
Threaded modifications continued: call ReconstructInstance at the end of the modification to update the DB model
Alain Mazy <am@osimis.io>
parents:
5134
diff
changeset
|
54 |
e71b22a43c0b
Threaded modifications continued: call ReconstructInstance at the end of the modification to update the DB model
Alain Mazy <am@osimis.io>
parents:
5134
diff
changeset
|
55 SharedMessageQueue instancesToProcessQueue_; |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
56 std::vector<boost::shared_ptr<boost::thread> > instancesWorkers_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
57 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
58 bool hasPostProcessing_; // final step before "KeepSource" cleanup |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
59 bool started_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
60 bool stopRequested_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
61 bool permissive_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
62 ThreadedJobStep currentStep_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
63 std::string description_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
64 size_t workersCount_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
65 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
66 ServerContext& context_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
67 bool keepSource_; |
5134
6aa41d86b948
fix ModificationJob state machine
Alain Mazy <am@osimis.io>
parents:
5130
diff
changeset
|
68 ErrorCode errorCode_; |
5137
15109c3f0f7d
added sanity checks in DicomModificationJob + automatically reconstruct resources at the end of a DicomModificationJob
Alain Mazy <am@osimis.io>
parents:
5136
diff
changeset
|
69 |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
70 protected: |
5137
15109c3f0f7d
added sanity checks in DicomModificationJob + automatically reconstruct resources at the end of a DicomModificationJob
Alain Mazy <am@osimis.io>
parents:
5136
diff
changeset
|
71 mutable boost::recursive_mutex mutex_; |
15109c3f0f7d
added sanity checks in DicomModificationJob + automatically reconstruct resources at the end of a DicomModificationJob
Alain Mazy <am@osimis.io>
parents:
5136
diff
changeset
|
72 std::set<std::string> parentResources_; |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
73 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
74 public: |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
75 ThreadedSetOfInstancesJob(ServerContext& context, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
76 bool hasTrailingStep, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
77 bool keepSource, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
78 size_t workersCount); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
79 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
80 explicit ThreadedSetOfInstancesJob(ServerContext& context, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
81 const Json::Value& source, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
82 bool hasTrailingStep, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
83 bool defaultKeepSource); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
84 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
85 virtual ~ThreadedSetOfInstancesJob(); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
86 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
87 protected: |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
88 virtual bool HandleInstance(const std::string& instance) = 0; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
89 |
5136
e71b22a43c0b
Threaded modifications continued: call ReconstructInstance at the end of the modification to update the DB model
Alain Mazy <am@osimis.io>
parents:
5134
diff
changeset
|
90 virtual void PostProcessInstances(); |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
91 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
92 void InitWorkers(size_t workersCount); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
93 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
94 void StopWorkers(); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
95 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
96 void WaitWorkersComplete(); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
97 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
98 static void InstanceWorkerThread(ThreadedSetOfInstancesJob* that); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
99 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
100 const std::string& GetInstance(size_t index) const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
101 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
102 bool HasPostProcessingStep() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
103 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
104 bool HasCleanupStep() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
105 |
5134
6aa41d86b948
fix ModificationJob state machine
Alain Mazy <am@osimis.io>
parents:
5130
diff
changeset
|
106 void SetErrorCode(ErrorCode errorCode); |
6aa41d86b948
fix ModificationJob state machine
Alain Mazy <am@osimis.io>
parents:
5130
diff
changeset
|
107 |
6aa41d86b948
fix ModificationJob state machine
Alain Mazy <am@osimis.io>
parents:
5130
diff
changeset
|
108 ErrorCode GetErrorCode() const; |
6aa41d86b948
fix ModificationJob state machine
Alain Mazy <am@osimis.io>
parents:
5130
diff
changeset
|
109 |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
110 public: |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
111 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
112 ThreadedJobStep GetCurrentStep() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
113 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
114 void SetDescription(const std::string& description); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
115 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
116 const std::string& GetDescription() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
117 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
118 void SetKeepSource(bool keep); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
119 |
5137
15109c3f0f7d
added sanity checks in DicomModificationJob + automatically reconstruct resources at the end of a DicomModificationJob
Alain Mazy <am@osimis.io>
parents:
5136
diff
changeset
|
120 bool IsKeepSource() const; |
15109c3f0f7d
added sanity checks in DicomModificationJob + automatically reconstruct resources at the end of a DicomModificationJob
Alain Mazy <am@osimis.io>
parents:
5136
diff
changeset
|
121 |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
122 void GetInstances(std::set<std::string>& target) const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
123 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
124 void GetFailedInstances(std::set<std::string>& target) const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
125 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
126 size_t GetInstancesCount() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
127 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
128 void AddInstances(const std::list<std::string>& instances); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
129 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
130 void AddParentResource(const std::string &resource); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
131 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
132 bool IsPermissive() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
133 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
134 void SetPermissive(bool permissive); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
135 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
136 virtual void Reset() ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
137 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
138 virtual void Start() ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
139 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
140 virtual void Stop(JobStopReason reason) ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
141 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
142 virtual float GetProgress() ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
143 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
144 bool IsStarted() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
145 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
146 virtual JobStepResult Step(const std::string& jobId) ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
147 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
148 virtual void GetPublicContent(Json::Value& value) ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
149 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
150 virtual bool Serialize(Json::Value& target) ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
151 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
152 virtual bool GetOutput(std::string& output, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
153 MimeType& mime, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
154 std::string& filename, |
5310
b5c502bcaf99
added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents:
5277
diff
changeset
|
155 const std::string& key) ORTHANC_OVERRIDE |
b5c502bcaf99
added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents:
5277
diff
changeset
|
156 { |
b5c502bcaf99
added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents:
5277
diff
changeset
|
157 return false; |
b5c502bcaf99
added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents:
5277
diff
changeset
|
158 } |
b5c502bcaf99
added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents:
5277
diff
changeset
|
159 |
b5c502bcaf99
added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents:
5277
diff
changeset
|
160 virtual bool DeleteOutput(const std::string& key) ORTHANC_OVERRIDE |
b5c502bcaf99
added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents:
5277
diff
changeset
|
161 { |
b5c502bcaf99
added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents:
5277
diff
changeset
|
162 return false; |
b5c502bcaf99
added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents:
5277
diff
changeset
|
163 } |
5130
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
164 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
165 bool IsFailedInstance(const std::string& instance) const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
166 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
167 ServerContext& GetContext() const |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
168 { |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
169 return context_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
170 } |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
171 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
172 }; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
173 } |