comparison OrthancServer/ServerContext.cpp @ 3713:56f2397f027a storage-commitment

integration mainline->storage-commitment
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 15:42:17 +0100
parents 9dac85e807c2 2a170a8f1faf
children 0540b54324f1
comparison
equal deleted inserted replaced
3711:14b363d972a8 3713:56f2397f027a
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 ||