Mercurial > hg > orthanc-stone
comparison Framework/Oracle/GenericOracleRunner.cpp @ 1299:c38c89684d83 broker
replacing std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 02 Mar 2020 17:21:24 +0100 |
parents | 0ca50d275b9a |
children | 30deba7bc8e2 |
comparison
equal
deleted
inserted
replaced
1297:6ab03e429f06 | 1299:c38c89684d83 |
---|---|
312 #endif | 312 #endif |
313 } | 313 } |
314 | 314 |
315 if (ok) | 315 if (ok) |
316 { | 316 { |
317 std::auto_ptr<Orthanc::ParsedDicomFile> result(new Orthanc::ParsedDicomFile(dicom)); | 317 std::unique_ptr<Orthanc::ParsedDicomFile> result(new Orthanc::ParsedDicomFile(dicom)); |
318 | 318 |
319 boost::posix_time::ptime end = boost::posix_time::microsec_clock::local_time(); | 319 boost::posix_time::ptime end = boost::posix_time::microsec_clock::local_time(); |
320 LOG(TRACE) << path << ": parsed in " << (end-start).total_milliseconds() << " ms"; | 320 LOG(TRACE) << path << ": parsed in " << (end-start).total_milliseconds() << " ms"; |
321 | 321 |
322 return result.release(); | 322 return result.release(); |
350 return; | 350 return; |
351 } | 351 } |
352 } | 352 } |
353 | 353 |
354 uint64_t fileSize; | 354 uint64_t fileSize; |
355 std::auto_ptr<Orthanc::ParsedDicomFile> parsed(ParseDicom(fileSize, path, command.IsPixelDataIncluded())); | 355 std::unique_ptr<Orthanc::ParsedDicomFile> parsed(ParseDicom(fileSize, path, command.IsPixelDataIncluded())); |
356 | 356 |
357 if (fileSize != static_cast<size_t>(fileSize)) | 357 if (fileSize != static_cast<size_t>(fileSize)) |
358 { | 358 { |
359 // Cannot load such a large file on 32-bit architecture | 359 // Cannot load such a large file on 32-bit architecture |
360 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotEnoughMemory); | 360 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotEnoughMemory); |
416 default: | 416 default: |
417 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); | 417 throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); |
418 } | 418 } |
419 | 419 |
420 size_t fileSize; | 420 size_t fileSize; |
421 std::auto_ptr<Orthanc::ParsedDicomFile> parsed(ParseDicomSuccessMessage::ParseWadoAnswer(fileSize, answer, answerHeaders)); | 421 std::unique_ptr<Orthanc::ParsedDicomFile> parsed(ParseDicomSuccessMessage::ParseWadoAnswer(fileSize, answer, answerHeaders)); |
422 | 422 |
423 { | 423 { |
424 ParseDicomSuccessMessage message(command, *parsed, fileSize, | 424 ParseDicomSuccessMessage message(command, *parsed, fileSize, |
425 true /* pixel data always is included in WADO-RS */); | 425 true /* pixel data always is included in WADO-RS */); |
426 emitter.EmitMessage(receiver, message); | 426 emitter.EmitMessage(receiver, message); |