diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-12-01 14:34:18 +0100 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-12-01 14:43:00 +0100 |
| commit | bc39d05453340257fff986edfdd728f2a89d13ad (patch) | |
| tree | 34fe208d1ccba0ae891dc23851352d3af6f7ee0f /libcmix-network/client.hpp | |
| parent | 95283582a0392633974d1f3f67d5510a16eb104c (diff) | |
| download | cmix-bc39d05453340257fff986edfdd728f2a89d13ad.tar.gz cmix-bc39d05453340257fff986edfdd728f2a89d13ad.tar.bz2 cmix-bc39d05453340257fff986edfdd728f2a89d13ad.zip | |
Removed a large chunk of code duplication in the network code.
Diffstat (limited to 'libcmix-network/client.hpp')
| -rw-r--r-- | libcmix-network/client.hpp | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/libcmix-network/client.hpp b/libcmix-network/client.hpp index b43f32b..7b2b16f 100644 --- a/libcmix-network/client.hpp +++ b/libcmix-network/client.hpp @@ -23,11 +23,13 @@ */ /*! - * \brief The Client class + * \brief Forward decl for the friend decleration in BaseClient; */ - struct SSLClient; +/*! + * \brief The BaseClient class takes care of all ssl agnostic operations. + */ template <typename T> class BaseClient { friend SSLClient; @@ -209,25 +211,14 @@ public: } }; -struct Client : private BaseClient<boost::asio::ip::tcp::socket> { - - using BaseClient::BaseClient; - using BaseClient::operator=; - - using BaseClient::async_receive; - - using BaseClient::async_send; - - using BaseClient::async_connect; - - using BaseClient::close; - - using BaseClient::on_done; - - using BaseClient::is_open; - -}; +/*! + * \brief Conveniance wrapper around BaseClient for non SSL sockets. + */ +using Client = BaseClient<boost::asio::ip::tcp::socket>; +/*! + * \brief The SSLClient struct A wrapper around BaseClient that takes care of some of the SSL specific things. + */ struct SSLClient : private BaseClient<boost::asio::ssl::stream<boost::asio::ip::tcp::socket>> { using BaseClient::BaseClient; |
