Mercurial > hg > orthanc
comparison Core/Cache/MemoryObjectCache.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 | 94f4a18a79cc |
children |
comparison
equal
deleted
inserted
replaced
3709:1f4910999fe7 | 3712:2a170a8f1faf |
---|---|
32 | 32 |
33 | 33 |
34 #include "../PrecompiledHeaders.h" | 34 #include "../PrecompiledHeaders.h" |
35 #include "MemoryObjectCache.h" | 35 #include "MemoryObjectCache.h" |
36 | 36 |
37 #include "../Compatibility.h" | |
38 | |
37 namespace Orthanc | 39 namespace Orthanc |
38 { | 40 { |
39 class MemoryObjectCache::Item : public boost::noncopyable | 41 class MemoryObjectCache::Item : public boost::noncopyable |
40 { | 42 { |
41 private: | 43 private: |
140 | 142 |
141 | 143 |
142 void MemoryObjectCache::Acquire(const std::string& key, | 144 void MemoryObjectCache::Acquire(const std::string& key, |
143 ICacheable* value) | 145 ICacheable* value) |
144 { | 146 { |
145 std::auto_ptr<Item> item(new Item(value)); | 147 std::unique_ptr<Item> item(new Item(value)); |
146 | 148 |
147 if (value == NULL) | 149 if (value == NULL) |
148 { | 150 { |
149 throw OrthancException(ErrorCode_NullPointer); | 151 throw OrthancException(ErrorCode_NullPointer); |
150 } | 152 } |