#pragma once #include "client.hpp" #include "cmix.pb.h" #include /*! * \file */ /*! * \brief The PrevNode class represents the previous node in the network, will only be received from. */ class PrevNode { Client client; public: /*! * \brief PrevNode * \param socket an rvalue reference to the socket it takes ownership and uses to communicate with the previous node in the network. */ PrevNode(Client&& socket); /*! * \brief PrevNode move assignment operator. */ PrevNode& operator=(PrevNode&&) = default; /*! * \brief receive Forwards a receive request to the client. * \param receive_handler The function to call with the received data. */ void receive(std::function const&)> receive_handler); /*! * \brief close This function closes the underlying socket connection. */ void close(); };