annotate OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.h @ 5857:39996519afce find-refactoring

fix limit/since restrictions
author Alain Mazy <am@orthanc.team>
date Mon, 04 Nov 2024 22:06:45 +0100
parents f7adfb22e20e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
5640
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5485
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5310
diff changeset
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
5130
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
8 *
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
9 * This program is free software: you can redistribute it and/or
5277
acaea72a3e91 Orthanc-1.12.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
10 * modify it under the terms of the GNU General Public License as
acaea72a3e91 Orthanc-1.12.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
11 * published by the Free Software Foundation, either version 3 of the
acaea72a3e91 Orthanc-1.12.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
12 * 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
13 *
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
14 * 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
15 * 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
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5277
acaea72a3e91 Orthanc-1.12.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
17 * General Public License for more details.
5130
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
18 *
5277
acaea72a3e91 Orthanc-1.12.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
19 * You should have received a copy of the GNU General Public License
acaea72a3e91 Orthanc-1.12.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
20 * 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
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 {
5145
df040c83796c correctly report ThreadedSetOfInstancesJob progress
Alain Mazy <am@osimis.io>
parents: 5137
diff changeset
44 ThreadedJobStep_NotStarted,
5130
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:
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
52 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
53 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
54 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
55
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
56 SharedMessageQueue instancesToProcessQueue_;
5130
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
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
59 bool hasPostProcessing_; // final step before "KeepSource" cleanup
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
60 bool started_;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
61 bool stopRequested_;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
62 bool permissive_;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
63 ThreadedJobStep currentStep_;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
64 std::string description_;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
65 size_t workersCount_;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
66
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
67 ServerContext& context_;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
68 bool keepSource_;
5134
6aa41d86b948 fix ModificationJob state machine
Alain Mazy <am@osimis.io>
parents: 5130
diff changeset
69 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
70
5130
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
71 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
72 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
73 std::set<std::string> parentResources_;
5130
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
74
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
75 public:
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
76 ThreadedSetOfInstancesJob(ServerContext& context,
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
77 bool hasTrailingStep,
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
78 bool keepSource,
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
79 size_t workersCount);
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
80
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
81 explicit ThreadedSetOfInstancesJob(ServerContext& context,
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
82 const Json::Value& source,
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
83 bool hasTrailingStep,
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
84 bool defaultKeepSource);
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 virtual ~ThreadedSetOfInstancesJob();
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
87
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
88 protected:
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
89 virtual bool HandleInstance(const std::string& instance) = 0;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
90
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
91 virtual void PostProcessInstances();
5130
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 InitWorkers(size_t workersCount);
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 StopWorkers();
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 void WaitWorkersComplete();
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 static void InstanceWorkerThread(ThreadedSetOfInstancesJob* that);
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 const std::string& GetInstance(size_t index) 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 HasPostProcessingStep() 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 bool HasCleanupStep() const;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
106
5134
6aa41d86b948 fix ModificationJob state machine
Alain Mazy <am@osimis.io>
parents: 5130
diff changeset
107 void SetErrorCode(ErrorCode errorCode);
6aa41d86b948 fix ModificationJob state machine
Alain Mazy <am@osimis.io>
parents: 5130
diff changeset
108
6aa41d86b948 fix ModificationJob state machine
Alain Mazy <am@osimis.io>
parents: 5130
diff changeset
109 ErrorCode GetErrorCode() const;
6aa41d86b948 fix ModificationJob state machine
Alain Mazy <am@osimis.io>
parents: 5130
diff changeset
110
5130
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
111 public:
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 ThreadedJobStep GetCurrentStep() const;
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 SetDescription(const std::string& description);
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 const std::string& GetDescription() 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 void SetKeepSource(bool keep);
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
120
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
121 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
122
5130
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
123 void GetInstances(std::set<std::string>& target) const;
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 void GetFailedInstances(std::set<std::string>& target) 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 size_t GetInstancesCount() const;
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 void AddInstances(const std::list<std::string>& instances);
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 void AddParentResource(const std::string &resource);
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 bool IsPermissive() const;
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 void SetPermissive(bool permissive);
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 virtual void Reset() ORTHANC_OVERRIDE;
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 void Start() 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 Stop(JobStopReason reason) 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 float GetProgress() 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 bool IsStarted() const;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
146
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
147 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
148
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
149 virtual void GetPublicContent(Json::Value& value) ORTHANC_OVERRIDE;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
150
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
151 virtual bool Serialize(Json::Value& target) ORTHANC_OVERRIDE;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
152
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
153 virtual bool GetOutput(std::string& output,
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
154 MimeType& mime,
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
155 std::string& filename,
5310
b5c502bcaf99 added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents: 5277
diff changeset
156 const std::string& key) ORTHANC_OVERRIDE
b5c502bcaf99 added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents: 5277
diff changeset
157 {
b5c502bcaf99 added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents: 5277
diff changeset
158 return false;
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
b5c502bcaf99 added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents: 5277
diff changeset
161 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
162 {
b5c502bcaf99 added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents: 5277
diff changeset
163 return false;
b5c502bcaf99 added a route to DELETE /jobs/../archive
Alain Mazy <am@osimis.io>
parents: 5277
diff changeset
164 }
5130
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
165
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
166 bool IsFailedInstance(const std::string& instance) const;
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
167
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
168 ServerContext& GetContext() const
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
169 {
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
170 return context_;
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 };
f2dcdbe05884 ResourceModification jobs can now use multiple threads
Alain Mazy <am@osimis.io>
parents:
diff changeset
174 }