comparison Core/JobsEngine/SetOfInstancesJob.cpp @ 2657:5eea2f11e8df jobs

JobsSerialization.GenericJobs
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 06 Jun 2018 16:52:42 +0200
parents a6d3e45eeff5
children 228e2783ce83
comparison
equal deleted inserted replaced
2656:a6d3e45eeff5 2657:5eea2f11e8df
112 static_cast<float>(instances_.size())); 112 static_cast<float>(instances_.size()));
113 } 113 }
114 } 114 }
115 115
116 116
117 const std::string& SetOfInstancesJob::GetInstance(size_t index) const
118 {
119 if (index > instances_.size())
120 {
121 throw OrthancException(ErrorCode_ParameterOutOfRange);
122 }
123 else
124 {
125 return instances_[index];
126 }
127 }
128
129
117 JobStepResult SetOfInstancesJob::ExecuteStep() 130 JobStepResult SetOfInstancesJob::ExecuteStep()
118 { 131 {
119 if (!started_) 132 if (!started_)
120 { 133 {
121 throw OrthancException(ErrorCode_InternalError); 134 throw OrthancException(ErrorCode_InternalError);
180 193
181 194
182 void SetOfInstancesJob::GetPublicContent(Json::Value& value) 195 void SetOfInstancesJob::GetPublicContent(Json::Value& value)
183 { 196 {
184 value["Description"] = GetDescription(); 197 value["Description"] = GetDescription();
185 value["InstancesCount"] = static_cast<uint32_t>(GetInstances().size()); 198 value["InstancesCount"] = static_cast<uint32_t>(instances_.size());
186 value["FailedInstancesCount"] = static_cast<uint32_t>(GetFailedInstances().size()); 199 value["FailedInstancesCount"] = static_cast<uint32_t>(failedInstances_.size());
187 } 200 }
188 201
189 202
190 void SetOfInstancesJob::Serialize(Json::Value& value) 203 void SetOfInstancesJob::Serialize(Json::Value& value)
191 { 204 {