aboutsummaryrefslogtreecommitdiff
path: root/libcmix-common/cmixprotofunctor.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcmix-common/cmixprotofunctor.hpp')
-rw-r--r--libcmix-common/cmixprotofunctor.hpp19
1 files changed, 19 insertions, 0 deletions
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
+};