]> granicus.if.org Git - icinga2/commitdiff
Turn shortcut UnbufferedAsioTlsStream::Parent into a base class
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Tue, 12 Mar 2019 10:36:30 +0000 (11:36 +0100)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Mon, 1 Apr 2019 11:31:16 +0000 (13:31 +0200)
lib/base/tlsstream.hpp

index 2432d16e86b89895464e5a2006e326eecb4a1de0..5f5fc6d7399a9e5af64594939c526da0dcd308a3 100644 (file)
@@ -106,11 +106,10 @@ struct UnbufferedAsioTlsStreamParams
        const String& Hostname;
 };
 
-class UnbufferedAsioTlsStream : public boost::asio::ssl::stream<boost::asio::ip::tcp::socket>
-{
-private:
-       typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> Parent;
+typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> AsioTcpTlsStream;
 
+class UnbufferedAsioTlsStream : public AsioTcpTlsStream
+{
 public:
        inline
        UnbufferedAsioTlsStream(UnbufferedAsioTlsStreamParams& init)
@@ -123,20 +122,20 @@ public:
 
        template<class... Args>
        inline
-       auto async_handshake(handshake_type type, Args&&... args) -> decltype(Parent::async_handshake(type, std::forward<Args>(args)...))
+       auto async_handshake(handshake_type type, Args&&... args) -> decltype(AsioTcpTlsStream::async_handshake(type, std::forward<Args>(args)...))
        {
                BeforeHandshake(type);
 
-               return Parent::async_handshake(type, std::forward<Args>(args)...);
+               return AsioTcpTlsStream::async_handshake(type, std::forward<Args>(args)...);
        }
 
        template<class... Args>
        inline
-       auto handshake(handshake_type type, Args&&... args) -> decltype(Parent::handshake(type, std::forward<Args>(args)...))
+       auto handshake(handshake_type type, Args&&... args) -> decltype(AsioTcpTlsStream::handshake(type, std::forward<Args>(args)...))
        {
                BeforeHandshake(type);
 
-               return Parent::handshake(type, std::forward<Args>(args)...);
+               return AsioTcpTlsStream::handshake(type, std::forward<Args>(args)...);
        }
 
 private: