annotate Core/JobsEngine/SetOfCommandsJob.cpp @ 2860:8b00e4cb4a6b

SetOfCommandsJob
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 05 Oct 2018 16:07:34 +0200
parents
children 437e6ba20a5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2860
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * program give permission to link the code of its release with the
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * your version of the file(s), but you are not obligated to do so. If
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * you do not wish to do so, delete this exception statement from your
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * version. If you delete this exception statement from all source files
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * in the program, then also delete it here.
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 *
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * This program is distributed in the hope that it will be useful, but
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * General Public License for more details.
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 *
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 **/
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #include "../PrecompiledHeaders.h"
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #include "SetOfCommandsJob.h"
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #include "../Logging.h"
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 #include "../OrthancException.h"
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 #include "../SerializationToolbox.h"
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 #include <cassert>
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 namespace Orthanc
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 SetOfCommandsJob::SetOfCommandsJob() :
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 started_(false),
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 permissive_(false),
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 position_(0)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 SetOfCommandsJob::~SetOfCommandsJob()
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 for (size_t i = 0; i < commands_.size(); i++)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 assert(commands_[i] != NULL);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 delete commands_[i];
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 void SetOfCommandsJob::Reserve(size_t size)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 if (started_)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 throw OrthancException(ErrorCode_BadSequenceOfCalls);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 else
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 commands_.reserve(size);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 void SetOfCommandsJob::AddCommand(ICommand* command)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 if (command == NULL)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 throw OrthancException(ErrorCode_NullPointer);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 else if (started_)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 throw OrthancException(ErrorCode_BadSequenceOfCalls);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 else
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 commands_.push_back(command);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 void SetOfCommandsJob::SetPermissive(bool permissive)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 if (started_)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 throw OrthancException(ErrorCode_BadSequenceOfCalls);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 else
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 permissive_ = permissive;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 void SetOfCommandsJob::Reset()
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 if (started_)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 position_ = 0;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 else
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 throw OrthancException(ErrorCode_BadSequenceOfCalls);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 float SetOfCommandsJob::GetProgress()
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 if (commands_.empty())
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 return 1;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 else
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 return (static_cast<float>(position_) /
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 static_cast<float>(commands_.size()));
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 const SetOfCommandsJob::ICommand& SetOfCommandsJob::GetCommand(size_t index) const
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 if (index >= commands_.size())
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 throw OrthancException(ErrorCode_ParameterOutOfRange);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 else
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 assert(commands_[index] != NULL);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 return *commands_[index];
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 JobStepResult SetOfCommandsJob::Step()
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 if (!started_)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 throw OrthancException(ErrorCode_InternalError);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 if (commands_.empty() &&
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 position_ == 0)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 // No command to handle: We're done
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 position_ = 1;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 return JobStepResult::Success();
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 if (position_ >= commands_.size())
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 // Already done
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 throw OrthancException(ErrorCode_BadSequenceOfCalls);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 try
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 // Not at the trailing step: Handle the current command
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 if (!commands_[position_]->Execute())
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 // Error
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 if (!permissive_)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 return JobStepResult::Failure(ErrorCode_InternalError);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 catch (OrthancException& e)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 if (permissive_)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 LOG(WARNING) << "Ignoring an error in a permissive job: " << e.What();
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 else
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 return JobStepResult::Failure(e.GetErrorCode());
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 position_ += 1;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 if (position_ == commands_.size())
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 // We're done
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 return JobStepResult::Success();
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 else
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 return JobStepResult::Continue();
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 static const char* KEY_DESCRIPTION = "Description";
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 static const char* KEY_PERMISSIVE = "Permissive";
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 static const char* KEY_POSITION = "Position";
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 static const char* KEY_TYPE = "Type";
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 static const char* KEY_COMMANDS = "Commands";
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 void SetOfCommandsJob::GetPublicContent(Json::Value& value)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 value[KEY_DESCRIPTION] = GetDescription();
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 bool SetOfCommandsJob::Serialize(Json::Value& target)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 target = Json::objectValue;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 std::string type;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 GetJobType(type);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 target[KEY_TYPE] = type;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 target[KEY_PERMISSIVE] = permissive_;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 target[KEY_POSITION] = static_cast<unsigned int>(position_);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 target[KEY_DESCRIPTION] = description_;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 target[KEY_COMMANDS] = Json::arrayValue;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 Json::Value& tmp = target[KEY_COMMANDS];
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 for (size_t i = 0; i < commands_.size(); i++)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 assert(commands_[i] != NULL);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 Json::Value command;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 commands_[i]->Serialize(command);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 tmp.append(command);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 return true;
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 SetOfCommandsJob::SetOfCommandsJob(ICommandUnserializer* unserializer,
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 const Json::Value& source) :
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 started_(false)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 std::auto_ptr<ICommandUnserializer> raii(unserializer);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 permissive_ = SerializationToolbox::ReadBoolean(source, KEY_PERMISSIVE);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 position_ = SerializationToolbox::ReadUnsignedInteger(source, KEY_POSITION);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 description_ = SerializationToolbox::ReadString(source, KEY_DESCRIPTION);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 if (!source.isMember(KEY_COMMANDS) ||
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 source[KEY_COMMANDS].type() != Json::arrayValue)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 throw OrthancException(ErrorCode_BadFileFormat);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 else
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 const Json::Value& tmp = source[KEY_COMMANDS];
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 commands_.resize(tmp.size());
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 for (Json::Value::ArrayIndex i = 0; i < tmp.size(); i++)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 try
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 commands_[i] = unserializer->Unserialize(tmp[i]);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 catch (OrthancException&)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 if (commands_[i] == NULL)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 for (size_t j = 0; j < i; j++)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 delete commands_[j];
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 throw OrthancException(ErrorCode_BadFileFormat);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 if (commands_.empty())
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 if (position_ > 1)
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 throw OrthancException(ErrorCode_BadFileFormat);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 else if (position_ > commands_.size())
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 {
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 throw OrthancException(ErrorCode_BadFileFormat);
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 }
8b00e4cb4a6b SetOfCommandsJob
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 }