Mercurial > hg > orthanc-authorization
comparison Plugin/CachedAuthorizationService.h @ 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 | c304ffca5d80 |
children | 14594077ad3a |
comparison
equal
deleted
inserted
replaced
35:9bdfa76c8923 | 36:8ada1b669194 |
---|---|
19 #pragma once | 19 #pragma once |
20 | 20 |
21 #include "IAuthorizationService.h" | 21 #include "IAuthorizationService.h" |
22 #include "ICacheFactory.h" | 22 #include "ICacheFactory.h" |
23 | 23 |
24 #include <Compatibility.h> // For std::unique_ptr<> | |
25 | |
24 #include <memory> | 26 #include <memory> |
25 | 27 |
26 namespace OrthancPlugins | 28 namespace OrthancPlugins |
27 { | 29 { |
28 /** | 30 /** |
29 * Decorator design pattern to add a cache around an IAuthorizationService | 31 * Decorator design pattern to add a cache around an IAuthorizationService |
30 **/ | 32 **/ |
31 class CachedAuthorizationService : public IAuthorizationService | 33 class CachedAuthorizationService : public IAuthorizationService |
32 { | 34 { |
33 private: | 35 private: |
34 std::auto_ptr<IAuthorizationService> decorated_; | 36 std::unique_ptr<IAuthorizationService> decorated_; |
35 std::auto_ptr<ICache> cache_; | 37 std::unique_ptr<ICache> cache_; |
36 | 38 |
37 std::string ComputeKey(OrthancPluginHttpMethod method, | 39 std::string ComputeKey(OrthancPluginHttpMethod method, |
38 const AccessedResource& access, | 40 const AccessedResource& access, |
39 const Token& token, | 41 const Token& token, |
40 const std::string& tokenValue) const; | 42 const std::string& tokenValue) const; |