#pragma once #include "senderreceiver.hpp" #include "api.h" #include "logging.hpp" #include "client.hpp" #include "connect.hpp" #include "cmix.pb.h" #include #include /*! * \file */ /*! * \brief The NodeDetails struct */ struct NodeDetails { std::string host; ///< The host of the node. std::string port; ///< The port of the node. }; /*! * \brief The CMixClient class */ class CMixClient { struct NodeData { SharedKey shared_value; }; boost::asio::io_service io_service; std::vector network_details; std::vector network_connections; std::vector data; Api api; KeyPair keypair; void key_exchange(int i); void initialize_connections(); void handle_key_exchange(int node_id, cmix_proto::KeyExchange const& ke); void handle_message(int node_id, cmix_proto::CMixMessage message); public: /*! * \brief CMixClient * \param details A vector of the connectiondetails for the cmix network */ CMixClient(std::vector details); ~CMixClient(); /*! * \brief run Runs the underlying io_service. */ void run(); };