Mercurial > hg > orthanc-webviewer
comparison Plugin/Plugin.cpp @ 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 |
comparison
equal
deleted
inserted
replaced
226:aee499712ac4 | 227:e4def26f0fd3 |
---|---|
61 }; | 61 }; |
62 | 62 |
63 Orthanc::FilesystemStorage storage_; | 63 Orthanc::FilesystemStorage storage_; |
64 Orthanc::SQLite::Connection db_; | 64 Orthanc::SQLite::Connection db_; |
65 | 65 |
66 std::auto_ptr<OrthancPlugins::CacheManager> cache_; | 66 std::unique_ptr<OrthancPlugins::CacheManager> cache_; |
67 std::auto_ptr<OrthancPlugins::CacheScheduler> scheduler_; | 67 std::unique_ptr<OrthancPlugins::CacheScheduler> scheduler_; |
68 | 68 |
69 Orthanc::SharedMessageQueue newInstances_; | 69 Orthanc::SharedMessageQueue newInstances_; |
70 bool stop_; | 70 bool stop_; |
71 boost::thread newInstancesThread_; | 71 boost::thread newInstancesThread_; |
72 OrthancPlugins::GdcmDecoderCache decoder_; | 72 OrthancPlugins::GdcmDecoderCache decoder_; |
73 | 73 |
74 static void NewInstancesThread(CacheContext* cache) | 74 static void NewInstancesThread(CacheContext* cache) |
75 { | 75 { |
76 while (!cache->stop_) | 76 while (!cache->stop_) |
77 { | 77 { |
78 std::auto_ptr<Orthanc::IDynamicObject> obj(cache->newInstances_.Dequeue(100)); | 78 std::unique_ptr<Orthanc::IDynamicObject> obj(cache->newInstances_.Dequeue(100)); |
79 if (obj.get() != NULL) | 79 if (obj.get() != NULL) |
80 { | 80 { |
81 const std::string& instanceId = dynamic_cast<DynamicString&>(*obj).GetValue(); | 81 const std::string& instanceId = dynamic_cast<DynamicString&>(*obj).GetValue(); |
82 | 82 |
83 // On the reception of a new instance, indalidate the parent series of the instance | 83 // On the reception of a new instance, indalidate the parent series of the instance |
413 { | 413 { |
414 *target = NULL; | 414 *target = NULL; |
415 return OrthancPluginErrorCode_Success; | 415 return OrthancPluginErrorCode_Success; |
416 } | 416 } |
417 | 417 |
418 std::auto_ptr<OrthancPlugins::OrthancImageWrapper> image; | 418 std::unique_ptr<OrthancPlugins::OrthancImageWrapper> image; |
419 | 419 |
420 #if 0 | 420 #if 0 |
421 // Do not use the cache | 421 // Do not use the cache |
422 OrthancPlugins::GdcmImageDecoder decoder(dicom, size); | 422 OrthancPlugins::GdcmImageDecoder decoder(dicom, size); |
423 image.reset(new OrthancPlugins::OrthancImageWrapper(context_, decoder, frameIndex)); | 423 image.reset(new OrthancPlugins::OrthancImageWrapper(context_, decoder, frameIndex)); |