From 366bae00016bfbfdd354ab010555c2927505b2b2 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Thu, 13 Oct 2016 14:35:32 +0200 Subject: Second big network rewrite. This time without the ugly SFINAE hack to restrict sending and receiving on Senders and Receivers respectively. Replaced this hack with private inheritance and using declerations. Also renamed receive to async_receive to better reflect the behaviour. --- libcmix-common/cmixprotofunctor.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 libcmix-common/cmixprotofunctor.hpp (limited to 'libcmix-common/cmixprotofunctor.hpp') diff --git a/libcmix-common/cmixprotofunctor.hpp b/libcmix-common/cmixprotofunctor.hpp new file mode 100644 index 0000000..c15f218 --- /dev/null +++ b/libcmix-common/cmixprotofunctor.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include "cmix.pb.h" + +struct CMixProtoFunctor { + + typedef cmix_proto::CMixMessage proto_type; + + #define MESSAGE_SETTER_DECL(TYPE) \ + proto_type operator()(cmix_proto::TYPE const& v) + + MESSAGE_SETTER_DECL(Initialization); + MESSAGE_SETTER_DECL(ImANode); + MESSAGE_SETTER_DECL(ImAClient); + MESSAGE_SETTER_DECL(Bye); + MESSAGE_SETTER_DECL(KeyExchange); + + #undef MESSAGE_SETTER +}; -- cgit v1.2.3-70-g09d2