diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-13 14:35:32 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-13 14:35:32 +0200 |
| commit | 366bae00016bfbfdd354ab010555c2927505b2b2 (patch) | |
| tree | e329c2ff179f62f093c6c53f84fb8faf4f5fccce /libcmix-common/cmixprotofunctor.cpp | |
| parent | d9587cfd27aa5ef26170ec1983b47f1e26dc8136 (diff) | |
| download | cmix-366bae00016bfbfdd354ab010555c2927505b2b2.tar.gz cmix-366bae00016bfbfdd354ab010555c2927505b2b2.tar.bz2 cmix-366bae00016bfbfdd354ab010555c2927505b2b2.zip | |
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.
Diffstat (limited to 'libcmix-common/cmixprotofunctor.cpp')
| -rw-r--r-- | libcmix-common/cmixprotofunctor.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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 |
