comparison Framework/Radiography/RadiographyAlphaLayer.cpp @ 1299:c38c89684d83 broker

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 17:21:24 +0100
parents 1c7ae79c426d
children 257f2c9a02ac
comparison
equal deleted inserted replaced
1297:6ab03e429f06 1299:c38c89684d83
30 namespace OrthancStone 30 namespace OrthancStone
31 { 31 {
32 32
33 void RadiographyAlphaLayer::SetAlpha(Orthanc::ImageAccessor* image) 33 void RadiographyAlphaLayer::SetAlpha(Orthanc::ImageAccessor* image)
34 { 34 {
35 std::auto_ptr<Orthanc::ImageAccessor> raii(image); 35 std::unique_ptr<Orthanc::ImageAccessor> raii(image);
36 36
37 if (image == NULL) 37 if (image == NULL)
38 { 38 {
39 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); 39 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
40 } 40 }
43 { 43 {
44 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); 44 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat);
45 } 45 }
46 46
47 SetSize(image->GetWidth(), image->GetHeight()); 47 SetSize(image->GetWidth(), image->GetHeight());
48 alpha_ = raii; 48
49 #if __cplusplus < 201103L
50 alpha_.reset(raii.release());
51 #else
52 alpha_ = std::move(raii);
53 #endif
49 54
50 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); 55 BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this));
51 } 56 }
52 57
53 void RadiographyAlphaLayer::Render(Orthanc::ImageAccessor& buffer, 58 void RadiographyAlphaLayer::Render(Orthanc::ImageAccessor& buffer,