OGLplus  (0.59.0) a C++ wrapper for rendering APIs

connection_kind.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_MESSAGE_BUS_CONNECTION_KIND_HPP
10 #define EAGINE_MESSAGE_BUS_CONNECTION_KIND_HPP
11 
12 #include "../bitfield.hpp"
13 #include "../reflect/map_enumerators.hpp"
14 #include <type_traits>
15 
16 namespace eagine::msgbus {
17 //------------------------------------------------------------------------------
21 enum class connection_kind : std::uint8_t {
23  unknown = 0U,
25  in_process = 1U << 0U,
27  local_interprocess = 1U << 1U,
29  remote_interprocess = 1U << 2U
30 };
31 //------------------------------------------------------------------------------
32 template <typename Selector>
33 constexpr auto
34 enumerator_mapping(type_identity<connection_kind>, Selector) noexcept {
35  return enumerator_map_type<connection_kind, 4>{
36  {{"unknown", connection_kind::unknown},
37  {"in_process", connection_kind::in_process},
38  {"local_interprocess", connection_kind::local_interprocess},
39  {"remote_interprocess", connection_kind::remote_interprocess}}};
40 }
41 //------------------------------------------------------------------------------
45 
46 static inline auto operator|(connection_kind l, connection_kind r) noexcept
47  -> connection_kinds {
48  return {l, r};
49 }
50 //------------------------------------------------------------------------------
51 } // namespace eagine::msgbus
52 
53 #endif // EAGINE_MESSAGE_BUS_CONNECTION_KIND_HPP
@ local_interprocess
Inter-process connection for local communication.
Class for manipulating and testing a group of enumeration-based bits.
Definition: bitfield.hpp:19
@ in_process
In-process connection (cannot be used for inter-process communication).
@ remote_interprocess
Inter-process connection for remote communucation.
Message bus code is placed in this namespace.
Definition: eagine.hpp:58
connection_kind
Message bus connection kind bits enumeration.
Definition: connection_kind.hpp:21
Template type used mostly for function type-tag dispatching.
Definition: type_identity.hpp:19
@ unknown
Unknown connection kind.

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).