comparison Core/DicomFormat/DicomMap.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 a9ce35d67c3c
children 56f2397f027a
comparison
equal deleted inserted replaced
3709:1f4910999fe7 3712:2a170a8f1faf
35 #include "DicomMap.h" 35 #include "DicomMap.h"
36 36
37 #include <stdio.h> 37 #include <stdio.h>
38 #include <memory> 38 #include <memory>
39 39
40 #include "../Compatibility.h"
40 #include "../Endianness.h" 41 #include "../Endianness.h"
41 #include "../Logging.h" 42 #include "../Logging.h"
42 #include "../OrthancException.h" 43 #include "../OrthancException.h"
43 #include "../Toolbox.h" 44 #include "../Toolbox.h"
44 #include "DicomArray.h" 45 #include "DicomArray.h"
298 299
299 300
300 301
301 DicomMap* DicomMap::Clone() const 302 DicomMap* DicomMap::Clone() const
302 { 303 {
303 std::auto_ptr<DicomMap> result(new DicomMap); 304 std::unique_ptr<DicomMap> result(new DicomMap);
304 305
305 for (Content::const_iterator it = content_.begin(); it != content_.end(); ++it) 306 for (Content::const_iterator it = content_.begin(); it != content_.end(); ++it)
306 { 307 {
307 result->content_.insert(std::make_pair(it->first, it->second->Clone())); 308 result->content_.insert(std::make_pair(it->first, it->second->Clone()));
308 } 309 }
1163 content_.find(tag) != content_.end()) 1164 content_.find(tag) != content_.end())
1164 { 1165 {
1165 throw OrthancException(ErrorCode_BadFileFormat); 1166 throw OrthancException(ErrorCode_BadFileFormat);
1166 } 1167 }
1167 1168
1168 std::auto_ptr<DicomValue> value(new DicomValue); 1169 std::unique_ptr<DicomValue> value(new DicomValue);
1169 value->Unserialize(source[tags[i]]); 1170 value->Unserialize(source[tags[i]]);
1170 1171
1171 content_[tag] = value.release(); 1172 content_[tag] = value.release();
1172 } 1173 }
1173 } 1174 }