Mercurial > hg > orthanc-webviewer
changeset 227:e4def26f0fd3
replacing std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 13 Mar 2020 12:38:45 +0100 |
parents | aee499712ac4 |
children | 0f9d183f685d |
files | Plugin/DecodedImageAdapter.cpp Plugin/Plugin.cpp |
diffstat | 2 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugin/DecodedImageAdapter.cpp Fri Jan 31 17:41:38 2020 +0100 +++ b/Plugin/DecodedImageAdapter.cpp Fri Mar 13 12:38:45 2020 +0100 @@ -150,7 +150,9 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_UnknownResource); } - std::auto_ptr<OrthancImageWrapper> image(new OrthancImageWrapper(context_, OrthancPluginDecodeDicomImage(context_, dicom.c_str(), dicom.size(), frameIndex))); + std::unique_ptr<OrthancImageWrapper> image( + new OrthancImageWrapper(context_, OrthancPluginDecodeDicomImage( + context_, dicom.c_str(), dicom.size(), frameIndex))); Json::Value json; if (GetCornerstoneMetadata(json, tags, *image)) @@ -315,7 +317,7 @@ accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetFormat()), image.GetWidth(), image.GetHeight(), image.GetPitch(), image.GetBuffer()); - std::auto_ptr<Orthanc::ImageBuffer> buffer; + std::unique_ptr<Orthanc::ImageBuffer> buffer; Orthanc::ImageAccessor converted; @@ -427,7 +429,7 @@ accessor.AssignReadOnly(OrthancPlugins::Convert(image.GetFormat()), image.GetWidth(), image.GetHeight(), image.GetPitch(), image.GetBuffer()); - std::auto_ptr<Orthanc::ImageBuffer> buffer; + std::unique_ptr<Orthanc::ImageBuffer> buffer; Orthanc::ImageAccessor converted;
--- a/Plugin/Plugin.cpp Fri Jan 31 17:41:38 2020 +0100 +++ b/Plugin/Plugin.cpp Fri Mar 13 12:38:45 2020 +0100 @@ -63,8 +63,8 @@ Orthanc::FilesystemStorage storage_; Orthanc::SQLite::Connection db_; - std::auto_ptr<OrthancPlugins::CacheManager> cache_; - std::auto_ptr<OrthancPlugins::CacheScheduler> scheduler_; + std::unique_ptr<OrthancPlugins::CacheManager> cache_; + std::unique_ptr<OrthancPlugins::CacheScheduler> scheduler_; Orthanc::SharedMessageQueue newInstances_; bool stop_; @@ -75,7 +75,7 @@ { while (!cache->stop_) { - std::auto_ptr<Orthanc::IDynamicObject> obj(cache->newInstances_.Dequeue(100)); + std::unique_ptr<Orthanc::IDynamicObject> obj(cache->newInstances_.Dequeue(100)); if (obj.get() != NULL) { const std::string& instanceId = dynamic_cast<DynamicString&>(*obj).GetValue(); @@ -415,7 +415,7 @@ return OrthancPluginErrorCode_Success; } - std::auto_ptr<OrthancPlugins::OrthancImageWrapper> image; + std::unique_ptr<OrthancPlugins::OrthancImageWrapper> image; #if 0 // Do not use the cache