diff options
author | louiz’ <louiz@louiz.org> | 2017-03-08 19:04:15 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-03-08 19:04:15 +0100 |
commit | f0bc6c83a8eb548d0a3edbf7c16a6922bfd24ba5 (patch) | |
tree | c9df36ef6781dfa56d2a3fee5b68390aa1e9ceb5 /louloulibs/network | |
parent | cd92baae3f0de8b841b5bbfdb02e4fa95acd52c1 (diff) | |
download | biboumi-f0bc6c83a8eb548d0a3edbf7c16a6922bfd24ba5.tar.gz biboumi-f0bc6c83a8eb548d0a3edbf7c16a6922bfd24ba5.tar.bz2 biboumi-f0bc6c83a8eb548d0a3edbf7c16a6922bfd24ba5.tar.xz biboumi-f0bc6c83a8eb548d0a3edbf7c16a6922bfd24ba5.zip |
Pass the shared_ptr by reference, to avoid useless copies
Diffstat (limited to 'louloulibs/network')
-rw-r--r-- | louloulibs/network/dns_handler.cpp | 2 | ||||
-rw-r--r-- | louloulibs/network/dns_handler.hpp | 2 | ||||
-rw-r--r-- | louloulibs/network/dns_socket_handler.cpp | 2 | ||||
-rw-r--r-- | louloulibs/network/dns_socket_handler.hpp | 2 | ||||
-rw-r--r-- | louloulibs/network/socket_handler.hpp | 2 | ||||
-rw-r--r-- | louloulibs/network/tcp_client_socket_handler.cpp | 2 | ||||
-rw-r--r-- | louloulibs/network/tcp_client_socket_handler.hpp | 2 | ||||
-rw-r--r-- | louloulibs/network/tcp_server_socket.hpp | 2 | ||||
-rw-r--r-- | louloulibs/network/tcp_socket_handler.cpp | 2 | ||||
-rw-r--r-- | louloulibs/network/tcp_socket_handler.hpp | 2 |
10 files changed, 10 insertions, 10 deletions
diff --git a/louloulibs/network/dns_handler.cpp b/louloulibs/network/dns_handler.cpp index fbd2763..641c087 100644 --- a/louloulibs/network/dns_handler.cpp +++ b/louloulibs/network/dns_handler.cpp @@ -17,7 +17,7 @@ using namespace std::string_literals; std::unique_ptr<DNSSocketHandler> DNSHandler::socket_handler{}; -DNSHandler::DNSHandler(std::shared_ptr<Poller> poller) +DNSHandler::DNSHandler(std::shared_ptr<Poller>& poller) { dns_init(nullptr, 0); const auto socket = dns_open(nullptr); diff --git a/louloulibs/network/dns_handler.hpp b/louloulibs/network/dns_handler.hpp index 78ffe4d..416f85f 100644 --- a/louloulibs/network/dns_handler.hpp +++ b/louloulibs/network/dns_handler.hpp @@ -14,7 +14,7 @@ class Poller; class DNSHandler { public: - explicit DNSHandler(std::shared_ptr<Poller> poller); + explicit DNSHandler(std::shared_ptr<Poller>& poller); ~DNSHandler() = default; DNSHandler(const DNSHandler&) = delete; diff --git a/louloulibs/network/dns_socket_handler.cpp b/louloulibs/network/dns_socket_handler.cpp index ad744a9..84e5625 100644 --- a/louloulibs/network/dns_socket_handler.cpp +++ b/louloulibs/network/dns_socket_handler.cpp @@ -7,7 +7,7 @@ #include <udns.h> -DNSSocketHandler::DNSSocketHandler(std::shared_ptr<Poller> poller, +DNSSocketHandler::DNSSocketHandler(std::shared_ptr<Poller>& poller, const socket_t socket): SocketHandler(poller, socket) { diff --git a/louloulibs/network/dns_socket_handler.hpp b/louloulibs/network/dns_socket_handler.hpp index e12f145..fc5f41f 100644 --- a/louloulibs/network/dns_socket_handler.hpp +++ b/louloulibs/network/dns_socket_handler.hpp @@ -12,7 +12,7 @@ class DNSSocketHandler: public SocketHandler { public: - explicit DNSSocketHandler(std::shared_ptr<Poller> poller, const socket_t socket); + explicit DNSSocketHandler(std::shared_ptr<Poller>& poller, const socket_t socket); ~DNSSocketHandler(); DNSSocketHandler(const DNSSocketHandler&) = delete; DNSSocketHandler(DNSSocketHandler&&) = delete; diff --git a/louloulibs/network/socket_handler.hpp b/louloulibs/network/socket_handler.hpp index 607a106..6a7220e 100644 --- a/louloulibs/network/socket_handler.hpp +++ b/louloulibs/network/socket_handler.hpp @@ -10,7 +10,7 @@ using socket_t = int; class SocketHandler { public: - explicit SocketHandler(std::shared_ptr<Poller> poller, const socket_t socket): + explicit SocketHandler(std::shared_ptr<Poller>& poller, const socket_t socket): poller(poller), socket(socket) {} diff --git a/louloulibs/network/tcp_client_socket_handler.cpp b/louloulibs/network/tcp_client_socket_handler.cpp index 530c3d9..4628703 100644 --- a/louloulibs/network/tcp_client_socket_handler.cpp +++ b/louloulibs/network/tcp_client_socket_handler.cpp @@ -11,7 +11,7 @@ using namespace std::string_literals; -TCPClientSocketHandler::TCPClientSocketHandler(std::shared_ptr<Poller> poller): +TCPClientSocketHandler::TCPClientSocketHandler(std::shared_ptr<Poller>& poller): TCPSocketHandler(poller), hostname_resolution_failed(false), connected(false), diff --git a/louloulibs/network/tcp_client_socket_handler.hpp b/louloulibs/network/tcp_client_socket_handler.hpp index 75e1364..74caca9 100644 --- a/louloulibs/network/tcp_client_socket_handler.hpp +++ b/louloulibs/network/tcp_client_socket_handler.hpp @@ -5,7 +5,7 @@ class TCPClientSocketHandler: public TCPSocketHandler { public: - TCPClientSocketHandler(std::shared_ptr<Poller> poller); + TCPClientSocketHandler(std::shared_ptr<Poller>& poller); ~TCPClientSocketHandler(); /** * Connect to the remote server, and call on_connected() if this diff --git a/louloulibs/network/tcp_server_socket.hpp b/louloulibs/network/tcp_server_socket.hpp index 7ea49ab..c511962 100644 --- a/louloulibs/network/tcp_server_socket.hpp +++ b/louloulibs/network/tcp_server_socket.hpp @@ -18,7 +18,7 @@ template <typename RemoteSocketType> class TcpSocketServer: public SocketHandler { public: - TcpSocketServer(std::shared_ptr<Poller> poller, const uint16_t port): + TcpSocketServer(std::shared_ptr<Poller>& poller, const uint16_t port): SocketHandler(poller, -1) { if ((this->socket = ::socket(AF_INET6, SOCK_STREAM, 0)) == -1) diff --git a/louloulibs/network/tcp_socket_handler.cpp b/louloulibs/network/tcp_socket_handler.cpp index 6aef2b1..7eebae0 100644 --- a/louloulibs/network/tcp_socket_handler.cpp +++ b/louloulibs/network/tcp_socket_handler.cpp @@ -44,7 +44,7 @@ using namespace std::chrono_literals; namespace ph = std::placeholders; -TCPSocketHandler::TCPSocketHandler(std::shared_ptr<Poller> poller): +TCPSocketHandler::TCPSocketHandler(std::shared_ptr<Poller>& poller): SocketHandler(poller, -1), use_tls(false) #ifdef BOTAN_FOUND diff --git a/louloulibs/network/tcp_socket_handler.hpp b/louloulibs/network/tcp_socket_handler.hpp index 600405d..3ee2f47 100644 --- a/louloulibs/network/tcp_socket_handler.hpp +++ b/louloulibs/network/tcp_socket_handler.hpp @@ -60,7 +60,7 @@ class TCPSocketHandler: public SocketHandler protected: ~TCPSocketHandler(); public: - explicit TCPSocketHandler(std::shared_ptr<Poller> poller); + explicit TCPSocketHandler(std::shared_ptr<Poller>& poller); TCPSocketHandler(const TCPSocketHandler&) = delete; TCPSocketHandler(TCPSocketHandler&&) = delete; TCPSocketHandler& operator=(const TCPSocketHandler&) = delete; |