Mercurial > hg > orthanc-authorization
changeset 36:8ada1b669194
replacing deprecated std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 06 Jul 2020 16:38:30 +0200 |
parents | 9bdfa76c8923 |
children | 680b1b1b9621 |
files | Plugin/AuthorizationParserBase.h Plugin/CachedAuthorizationService.h Plugin/Plugin.cpp Plugin/ResourceHierarchyCache.h Resources/Orthanc/DownloadOrthancFramework.cmake |
diffstat | 5 files changed, 17 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugin/AuthorizationParserBase.h Wed Jul 01 16:10:12 2020 +0200 +++ b/Plugin/AuthorizationParserBase.h Mon Jul 06 16:38:30 2020 +0200 @@ -21,12 +21,14 @@ #include "IAuthorizationParser.h" #include "ResourceHierarchyCache.h" +#include <Compatibility.h> // For std::unique_ptr<> + namespace OrthancPlugins { class AuthorizationParserBase : public IAuthorizationParser { private: - std::auto_ptr<ResourceHierarchyCache> resourceHierarchy_; + std::unique_ptr<ResourceHierarchyCache> resourceHierarchy_; void AddResourceInternal(AccessedResources& target, Orthanc::ResourceType level,
--- a/Plugin/CachedAuthorizationService.h Wed Jul 01 16:10:12 2020 +0200 +++ b/Plugin/CachedAuthorizationService.h Mon Jul 06 16:38:30 2020 +0200 @@ -21,6 +21,8 @@ #include "IAuthorizationService.h" #include "ICacheFactory.h" +#include <Compatibility.h> // For std::unique_ptr<> + #include <memory> namespace OrthancPlugins @@ -31,8 +33,8 @@ class CachedAuthorizationService : public IAuthorizationService { private: - std::auto_ptr<IAuthorizationService> decorated_; - std::auto_ptr<ICache> cache_; + std::unique_ptr<IAuthorizationService> decorated_; + std::unique_ptr<ICache> cache_; std::string ComputeKey(OrthancPluginHttpMethod method, const AccessedResource& access,
--- a/Plugin/Plugin.cpp Wed Jul 01 16:10:12 2020 +0200 +++ b/Plugin/Plugin.cpp Mon Jul 06 16:38:30 2020 +0200 @@ -24,13 +24,14 @@ #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" +#include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> #include <Toolbox.h> // Configuration of the authorization plugin -static std::auto_ptr<OrthancPlugins::IAuthorizationParser> authorizationParser_; -static std::auto_ptr<OrthancPlugins::IAuthorizationService> authorizationService_; +static std::unique_ptr<OrthancPlugins::IAuthorizationParser> authorizationParser_; +static std::unique_ptr<OrthancPlugins::IAuthorizationService> authorizationService_; static std::set<std::string> uncheckedResources_; static std::list<std::string> uncheckedFolders_; static std::list<OrthancPlugins::Token> tokens_;
--- a/Plugin/ResourceHierarchyCache.h Wed Jul 01 16:10:12 2020 +0200 +++ b/Plugin/ResourceHierarchyCache.h Mon Jul 06 16:38:30 2020 +0200 @@ -22,17 +22,18 @@ #include "Enumerations.h" #include "OrthancResource.h" +#include <Compatibility.h> // For std::unique_ptr<> + #include <orthanc/OrthancCPlugin.h> -#include <memory> namespace OrthancPlugins { class ResourceHierarchyCache : public boost::noncopyable { private: - std::auto_ptr<ICache> cache_; // Maps resources to their parents - std::auto_ptr<ICache> orthancToDicom_; - std::auto_ptr<ICache> dicomToOrthanc_; + std::unique_ptr<ICache> cache_; // Maps resources to their parents + std::unique_ptr<ICache> orthancToDicom_; + std::unique_ptr<ICache> dicomToOrthanc_; std::string ComputeKey(Orthanc::ResourceType level, const std::string identifier) const;
--- a/Resources/Orthanc/DownloadOrthancFramework.cmake Wed Jul 01 16:10:12 2020 +0200 +++ b/Resources/Orthanc/DownloadOrthancFramework.cmake Mon Jul 06 16:38:30 2020 +0200 @@ -396,7 +396,7 @@ ## ## Case of the Orthanc framework installed as a shared library in a -## GNU/Linux distribution (typically Debian) +## GNU/Linux distribution (typically Debian). New in Orthanc 1.7.2. ## if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") @@ -438,7 +438,7 @@ # Look for mandatory dependency Boost (cf. BoostConfiguration.cmake) include(FindBoost) - find_package(Boost COMPONENTS filesystem thread system date_time regex) + find_package(Boost COMPONENTS filesystem thread system date_time regex ${ORTHANC_BOOST_COMPONENTS}) if (NOT Boost_FOUND) message(FATAL_ERROR "Unable to locate Boost on this system") @@ -485,14 +485,6 @@ endif() endif() - # Optional component - Google Test - if (ENABLE_GOOGLE_TEST) - set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") - set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)") - mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE) - include(${CMAKE_CURRENT_LIST_DIR}/GoogleTestConfiguration.cmake) - endif() - # Look for Orthanc framework shared library include(CheckCXXSymbolExists)