From 0c1d1a0f24655c22a373c19aac90a6a225a353e6 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 8 Dec 2018 10:43:50 +0100 Subject: wanda: reformat source code --- src/control_connection.hpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src/control_connection.hpp') diff --git a/src/control_connection.hpp b/src/control_connection.hpp index bd3db9d..8ed60f0 100644 --- a/src/control_connection.hpp +++ b/src/control_connection.hpp @@ -15,24 +15,23 @@ namespace wanda { - -struct control_connection : keyed, std::enable_shared_from_this -{ + struct control_connection : keyed, std::enable_shared_from_this + { using protocol = asio::local::stream_protocol; using pointer = std::shared_ptr; struct listener { - virtual void on_close(pointer connection) {} - virtual void on_received(pointer connection, message message) {} - virtual void on_error(pointer connection, std::error_code) {} + virtual void on_close(pointer connection) {} + virtual void on_received(pointer connection, message message) {} + virtual void on_error(pointer connection, std::error_code) {} }; enum struct state : std::underlying_type_t { - unknown, - fresh, - established, + unknown, + fresh, + established, }; /** @@ -48,14 +47,14 @@ struct control_connection : keyed, std::enable_shared_from_t * * @returns true iff. the listener was not already in the listener set */ - bool add(listener *listener); + bool add(listener * listener); /** * @brief Remove the given listener from this control connection's listener set * * @return true iff. the listener was previously registered with this control connection */ - bool remove(listener *listener); + bool remove(listener * listener); /** * @brief Start I/O processing for this control connection @@ -74,7 +73,7 @@ struct control_connection : keyed, std::enable_shared_from_t state current_state() const; private: - friend pointer make_control_connection(protocol::socket &&socket); + friend pointer make_control_connection(protocol::socket && socket); void perform_read(); @@ -85,10 +84,10 @@ struct control_connection : keyed, std::enable_shared_from_t std::ostream m_output{&m_out}; std::set m_listeners{}; state m_state{}; -}; + }; -control_connection::pointer make_control_connection(control_connection::protocol::socket &&socket); + control_connection::pointer make_control_connection(control_connection::protocol::socket && socket); -} // namespace wanda +} // namespace wanda #endif \ No newline at end of file -- cgit v1.2.3