Mercurial > hg > orthanc
comparison OrthancServer/ServerContext.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 | 6358923d3ced |
children | 56f2397f027a |
comparison
equal
deleted
inserted
replaced
3709:1f4910999fe7 | 3712:2a170a8f1faf |
---|---|
73 void ServerContext::ChangeThread(ServerContext* that, | 73 void ServerContext::ChangeThread(ServerContext* that, |
74 unsigned int sleepDelay) | 74 unsigned int sleepDelay) |
75 { | 75 { |
76 while (!that->done_) | 76 while (!that->done_) |
77 { | 77 { |
78 std::auto_ptr<IDynamicObject> obj(that->pendingChanges_.Dequeue(sleepDelay)); | 78 std::unique_ptr<IDynamicObject> obj(that->pendingChanges_.Dequeue(sleepDelay)); |
79 | 79 |
80 if (obj.get() != NULL) | 80 if (obj.get() != NULL) |
81 { | 81 { |
82 const ServerIndexChange& change = dynamic_cast<const ServerIndexChange&>(*obj.get()); | 82 const ServerIndexChange& change = dynamic_cast<const ServerIndexChange&>(*obj.get()); |
83 | 83 |
662 const std::string& instancePublicId) : | 662 const std::string& instancePublicId) : |
663 that_(that), | 663 that_(that), |
664 lock_(that_.dicomCacheMutex_) | 664 lock_(that_.dicomCacheMutex_) |
665 { | 665 { |
666 #if ENABLE_DICOM_CACHE == 0 | 666 #if ENABLE_DICOM_CACHE == 0 |
667 static std::auto_ptr<IDynamicObject> p; | 667 static std::unique_ptr<IDynamicObject> p; |
668 p.reset(provider_.Provide(instancePublicId)); | 668 p.reset(provider_.Provide(instancePublicId)); |
669 dicom_ = dynamic_cast<ParsedDicomFile*>(p.get()); | 669 dicom_ = dynamic_cast<ParsedDicomFile*>(p.get()); |
670 #else | 670 #else |
671 dicom_ = &dynamic_cast<ParsedDicomFile&>(that_.dicomCache_.Access(instancePublicId)); | 671 dicom_ = &dynamic_cast<ParsedDicomFile&>(that_.dicomCache_.Access(instancePublicId)); |
672 #endif | 672 #endif |
831 for (size_t i = 0; i < instances.size(); i++) | 831 for (size_t i = 0; i < instances.size(); i++) |
832 { | 832 { |
833 // Optimization in Orthanc 1.5.1 - Don't read the full JSON from | 833 // Optimization in Orthanc 1.5.1 - Don't read the full JSON from |
834 // the disk if only "main DICOM tags" are to be returned | 834 // the disk if only "main DICOM tags" are to be returned |
835 | 835 |
836 std::auto_ptr<Json::Value> dicomAsJson; | 836 std::unique_ptr<Json::Value> dicomAsJson; |
837 | 837 |
838 bool hasOnlyMainDicomTags; | 838 bool hasOnlyMainDicomTags; |
839 DicomMap dicom; | 839 DicomMap dicom; |
840 | 840 |
841 if (findStorageAccessMode_ == FindStorageAccessMode_DatabaseOnly || | 841 if (findStorageAccessMode_ == FindStorageAccessMode_DatabaseOnly || |