Mercurial > hg > orthanc
annotate OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.h @ 5130:f2dcdbe05884
ResourceModification jobs can now use multiple threads
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 05 Jan 2023 17:24:43 +0100 |
parents | |
children | 6aa41d86b948 |
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 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
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 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public License |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
10 * as published by the Free Software Foundation, either version 3 of |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
11 * the License, or (at your option) any later version. |
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 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
17 * |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
19 * License along with this program. If not, see |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
20 * <http://www.gnu.org/licenses/>. |
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 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
24 #pragma once |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
25 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
26 #include "../../../OrthancFramework/Sources/Compatibility.h" // For ORTHANC_OVERRIDE |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
27 #include "../../../OrthancFramework/Sources/JobsEngine/IJob.h" |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
28 #include "../../../OrthancFramework/Sources/MultiThreading/SharedMessageQueue.h" |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
29 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
30 #include <set> |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
31 #include <boost/thread/recursive_mutex.hpp> |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
32 #include <boost/thread.hpp> |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
33 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
34 namespace Orthanc |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
35 { |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
36 class ServerContext; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
37 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
38 // 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
|
39 class ORTHANC_PUBLIC ThreadedSetOfInstancesJob : public IJob |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
40 { |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
41 public: |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
42 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
|
43 { |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
44 ThreadedJobStep_BeforeStart, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
45 ThreadedJobStep_ProcessingInstances, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
46 ThreadedJobStep_PostProcessingInstances, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
47 ThreadedJobStep_Cleanup, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
48 ThreadedJobStep_Done |
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 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
51 private: |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
52 std::set<std::string> failedInstances_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
53 std::set<std::string> parentResources_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
54 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
55 size_t processedInstancesCount_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
56 SharedMessageQueue instancesToProcess_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
57 std::vector<boost::shared_ptr<boost::thread> > instancesWorkers_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
58 std::set<std::string> instances_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
59 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
60 bool hasPostProcessing_; // final step before "KeepSource" cleanup |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
61 bool started_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
62 bool stopRequested_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
63 bool permissive_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
64 ThreadedJobStep currentStep_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
65 std::string description_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
66 size_t workersCount_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
67 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
68 ServerContext& context_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
69 bool keepSource_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
70 protected: |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
71 mutable boost::recursive_mutex mutex_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
72 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
73 public: |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
74 ThreadedSetOfInstancesJob(ServerContext& context, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
75 bool hasTrailingStep, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
76 bool keepSource, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
77 size_t workersCount); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
78 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
79 explicit ThreadedSetOfInstancesJob(ServerContext& context, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
80 const Json::Value& source, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
81 bool hasTrailingStep, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
82 bool defaultKeepSource); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
83 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
84 virtual ~ThreadedSetOfInstancesJob(); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
85 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
86 protected: |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
87 virtual bool HandleInstance(const std::string& instance) = 0; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
88 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
89 virtual void PostProcessInstances() {} |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
90 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
91 void InitWorkers(size_t workersCount); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
92 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
93 void StopWorkers(); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
94 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
95 void WaitWorkersComplete(); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
96 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
97 static void InstanceWorkerThread(ThreadedSetOfInstancesJob* that); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
98 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
99 const std::string& GetInstance(size_t index) const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
100 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
101 bool HasPostProcessingStep() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
102 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
103 bool HasCleanupStep() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
104 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
105 public: |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
106 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
107 ThreadedJobStep GetCurrentStep() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
108 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
109 void SetDescription(const std::string& description); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
110 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
111 const std::string& GetDescription() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
112 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
113 void SetKeepSource(bool keep); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
114 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
115 void GetInstances(std::set<std::string>& target) const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
116 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
117 void GetFailedInstances(std::set<std::string>& target) const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
118 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
119 size_t GetInstancesCount() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
120 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
121 void AddInstances(const std::list<std::string>& instances); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
122 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
123 void AddParentResource(const std::string &resource); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
124 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
125 bool IsPermissive() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
126 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
127 void SetPermissive(bool permissive); |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
128 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
129 virtual void Reset() ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
130 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
131 virtual void Start() ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
132 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
133 virtual void Stop(JobStopReason reason) ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
134 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
135 virtual float GetProgress() ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
136 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
137 bool IsStarted() const; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
138 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
139 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
|
140 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
141 virtual void GetPublicContent(Json::Value& value) ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
142 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
143 virtual bool Serialize(Json::Value& target) ORTHANC_OVERRIDE; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
144 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
145 virtual bool GetOutput(std::string& output, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
146 MimeType& mime, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
147 std::string& filename, |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
148 const std::string& key) 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 bool IsFailedInstance(const std::string& instance) const; |
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 ServerContext& GetContext() const |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
153 { |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
154 return context_; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
155 } |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
156 |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
157 }; |
f2dcdbe05884
ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
158 } |