Mercurial > irccd
changeset 764:46ec61c095c1
Irccd: style (transport_service)
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 13 Aug 2018 13:54:50 +0200 |
parents | 4283dc118339 |
children | 3f5e8ae58a84 |
files | libirccd/irccd/daemon/transport_service.cpp libirccd/irccd/daemon/transport_service.hpp |
diffstat | 2 files changed, 17 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/libirccd/irccd/daemon/transport_service.cpp Mon Aug 13 13:50:11 2018 +0200 +++ b/libirccd/irccd/daemon/transport_service.cpp Mon Aug 13 13:54:50 2018 +0200 @@ -74,7 +74,7 @@ tc->error(irccd_error::invalid_message); break; default: - // Other error may still happen. + // Other errors. if (!code) { handle_command(tc, json); @@ -106,6 +106,16 @@ transport_service::~transport_service() noexcept = default; +auto transport_service::get_commands() const noexcept -> const commands& +{ + return commands_; +} + +auto transport_service::get_commands() noexcept -> commands& +{ + return commands_; +} + void transport_service::add(std::shared_ptr<transport_server> ts) { assert(ts);
--- a/libirccd/irccd/daemon/transport_service.hpp Mon Aug 13 13:50:11 2018 +0200 +++ b/libirccd/irccd/daemon/transport_service.hpp Mon Aug 13 13:54:50 2018 +0200 @@ -38,13 +38,13 @@ */ class transport_service { public: - using commands_t = std::vector<std::unique_ptr<command>>; - using servers_t = std::vector<std::shared_ptr<transport_server>>; + using commands = std::vector<std::unique_ptr<command>>; + using servers = std::vector<std::shared_ptr<transport_server>>; private: irccd& irccd_; - commands_t commands_; - servers_t servers_; + commands commands_; + servers servers_; void handle_command(std::shared_ptr<transport_client>, const nlohmann::json&); void do_recv(std::shared_ptr<transport_client>); @@ -68,20 +68,14 @@ * * \return the commands */ - inline const commands_t& get_commands() const noexcept - { - return commands_; - } + auto get_commands() const noexcept -> const commands&; /** * Get underlying commands. * * \return the commands */ - inline commands_t& get_commands() noexcept - { - return commands_; - } + auto get_commands() noexcept -> commands&; /** * Add a transport server.