From 3fe7a5b6a18b6841ae51f294dc58fe9c8df6d375 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Wed, 28 Sep 2016 13:18:18 +0200 Subject: Finally made a initial doxygen documentation pass over all files. --- libcmix-network/client.hpp | 48 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'libcmix-network/client.hpp') diff --git a/libcmix-network/client.hpp b/libcmix-network/client.hpp index 46b989d..981283b 100644 --- a/libcmix-network/client.hpp +++ b/libcmix-network/client.hpp @@ -5,22 +5,66 @@ #include +/*! + * \file + */ + +/*! + * \brief The Client class + */ class Client { public: + /*! + * \brief OnDoneFT Function type of the function being called when this instance is done operating. + */ typedef std::function OnDoneFT; + + /*! + * \brief MessageHandler Function type of the function handling incoming messages. + */ typedef std::function)> MessageHandler; protected: + /*! + * \brief socket The socket connection this instance handles. + */ boost::asio::ip::tcp::socket socket; private: + /*! + * \brief buffer Internal private buffer used to receive messages. + */ boost::asio::streambuf buffer; + + /*! + * \brief done The done function being called when this is done operating. + */ OnDoneFT done; + /*! + * \brief handle_receive + * \param message_handler The function to call when a message has been received. + * \param ec A possible error that occured during receiving. + * \param read_bytes The number of bytes read. + */ + void handle_receive(MessageHandler message_handler, boost::system::error_code const& ec, size_t read_bytes); + public: + /*! + * \brief Client + * \param socket An rvalue reference to a socket it will now own and receive from. + */ Client(boost::asio::ip::tcp::socket&& socket); - - void handle_receive(MessageHandler message_handler, boost::system::error_code const& ec, size_t read_bytes); + + /*! + * \brief receive + * \param message_handler The function to call when a message has been received. + */ void receive(MessageHandler message_handler); + + /*! + * \brief on_done sets the done callback. + * \param f The new done callback function. + */ void on_done(OnDoneFT f); }; -- cgit v1.2.3-70-g09d2