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.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 libcmix-common/cmixprotofunctor.cpp (limited to 'libcmix-common/cmixprotofunctor.cpp') diff --git a/libcmix-common/cmixprotofunctor.cpp b/libcmix-common/cmixprotofunctor.cpp new file mode 100644 index 0000000..a026628 --- /dev/null +++ b/libcmix-common/cmixprotofunctor.cpp @@ -0,0 +1,16 @@ +#include "cmixprotofunctor.hpp" + +#define MESSAGE_SETTER_DEF(TYPE, NAME) \ + CMixProtoFunctor::proto_type CMixProtoFunctor::operator()(cmix_proto::TYPE const& v) { \ + proto_type m; \ + *m.mutable_##NAME() = v; \ + return m; \ + } \ + +MESSAGE_SETTER_DEF(Initialization, initialization) +MESSAGE_SETTER_DEF(ImANode, imanode) +MESSAGE_SETTER_DEF(ImAClient, imaclient) +MESSAGE_SETTER_DEF(Bye, bye) +MESSAGE_SETTER_DEF(KeyExchange, keyexchange) + +#undef MESSAGE_SETTER_DEF \ No newline at end of file -- cgit v1.2.3-70-g09d2