aboutsummaryrefslogtreecommitdiff
path: root/node/node.hpp
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-10-16 21:38:43 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-10-16 21:38:43 +0200
commitc9082aa07394e15cd800bd5ad396c37a2334c98d (patch)
tree2c14dbbf4faba3b7cc02469d26084486bf7114e5 /node/node.hpp
parent20139a86eddc062fdbaacad0d7d6fdbd999f2e18 (diff)
downloadcmix-c9082aa07394e15cd800bd5ad396c37a2334c98d.tar.gz
cmix-c9082aa07394e15cd800bd5ad396c37a2334c98d.tar.bz2
cmix-c9082aa07394e15cd800bd5ad396c37a2334c98d.zip
made the code base more consistent and fixes some small TU issues.
Diffstat (limited to 'node/node.hpp')
-rw-r--r--node/node.hpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/node/node.hpp b/node/node.hpp
index 76f3c0d..9dfc343 100644
--- a/node/node.hpp
+++ b/node/node.hpp
@@ -31,12 +31,20 @@ struct NodeNetworkSettings {
*/
class Node
{
+ struct CMixClientData {
+ SharedKey shared_value;
+ };
+
boost::asio::io_service io_service;
Server server;
- std::list<Receiver> purgatory;
- typedef std::map<std::string, SenderReceiver> ClientMap;
- ClientMap clients;
+ typedef std::list<Receiver> Purgatory;
+ Purgatory purgatory;
+
+ typedef std::map<std::string, SenderReceiver> ClientConnections;
+ ClientConnections clients;
+ typedef std::map<std::string, CMixClientData> ClientData;
+ ClientData data;
NodeNetworkSettings network_settings;
@@ -60,13 +68,13 @@ class Node
void handle_node_bye(cmix_proto::Bye);
void handle_node_message(cmix_proto::CMixMessage message);
- void handle_client_keyexchange(ClientMap::key_type handle, cmix_proto::KeyExchange ke);
- void handle_client_bye(ClientMap::key_type handle, cmix_proto::Bye);
- void handle_client_message(ClientMap::key_type handle, cmix_proto::CMixMessage message);
+ void handle_client_keyexchange(ClientConnections::key_type handle, cmix_proto::KeyExchange ke);
+ void handle_client_bye(ClientConnections::key_type handle, cmix_proto::Bye);
+ void handle_client_message(ClientConnections::key_type handle, cmix_proto::CMixMessage message);
- void handle_imanode(std::list<Receiver>::iterator handle);
- void handle_imaclient(std::list<Receiver>::iterator handle, cmix_proto::ImAClient c);
- void handle_message(std::list<Receiver>::iterator handle, cmix_proto::CMixMessage message);
+ void handle_imanode(Purgatory::iterator handle);
+ void handle_imaclient(Purgatory::iterator handle, cmix_proto::ImAClient c);
+ void handle_message(Purgatory::iterator handle, cmix_proto::CMixMessage message);
public:
/*!