comparison OrthancServer/OrthancRestApi/OrthancRestApi.cpp @ 3712:2a170a8f1faf

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 15:32:45 +0100
parents e85bfba2d307
children 023b2a9f3aa1 be7df7fe3d80
comparison
equal deleted inserted replaced
3709:1f4910999fe7 3712:2a170a8f1faf
252 ServerContext& context, 252 ServerContext& context,
253 IJob* job, 253 IJob* job,
254 bool synchronous, 254 bool synchronous,
255 int priority) 255 int priority)
256 { 256 {
257 std::auto_ptr<IJob> raii(job); 257 std::unique_ptr<IJob> raii(job);
258 258
259 if (job == NULL) 259 if (job == NULL)
260 { 260 {
261 throw OrthancException(ErrorCode_NullPointer); 261 throw OrthancException(ErrorCode_NullPointer);
262 } 262 }
288 void OrthancRestApi::SubmitGenericJob(RestApiPostCall& call, 288 void OrthancRestApi::SubmitGenericJob(RestApiPostCall& call,
289 IJob* job, 289 IJob* job,
290 bool isDefaultSynchronous, 290 bool isDefaultSynchronous,
291 const Json::Value& body) const 291 const Json::Value& body) const
292 { 292 {
293 std::auto_ptr<IJob> raii(job); 293 std::unique_ptr<IJob> raii(job);
294 294
295 if (body.type() != Json::objectValue) 295 if (body.type() != Json::objectValue)
296 { 296 {
297 throw OrthancException(ErrorCode_BadFileFormat); 297 throw OrthancException(ErrorCode_BadFileFormat);
298 } 298 }
307 void OrthancRestApi::SubmitCommandsJob(RestApiPostCall& call, 307 void OrthancRestApi::SubmitCommandsJob(RestApiPostCall& call,
308 SetOfCommandsJob* job, 308 SetOfCommandsJob* job,
309 bool isDefaultSynchronous, 309 bool isDefaultSynchronous,
310 const Json::Value& body) const 310 const Json::Value& body) const
311 { 311 {
312 std::auto_ptr<SetOfCommandsJob> raii(job); 312 std::unique_ptr<SetOfCommandsJob> raii(job);
313 313
314 if (body.type() != Json::objectValue) 314 if (body.type() != Json::objectValue)
315 { 315 {
316 throw OrthancException(ErrorCode_BadFileFormat); 316 throw OrthancException(ErrorCode_BadFileFormat);
317 } 317 }