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

types.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_MESSAGE_BUS_TYPES_HPP
10 #define EAGINE_MESSAGE_BUS_TYPES_HPP
11 
12 #include "../identifier_t.hpp"
13 #include "../reflect/map_data_members.hpp"
14 #include "../types.hpp"
15 #include "connection_kind.hpp"
16 #include <tuple>
17 
18 namespace eagine::msgbus {
19 //------------------------------------------------------------------------------
22 using message_sequence_t = std::uint32_t;
23 //------------------------------------------------------------------------------
29 
32 
35 
38 };
39 
40 template <typename Selector>
41 constexpr auto
42 data_member_mapping(type_identity<router_topology_info>, Selector) noexcept {
43  using S = router_topology_info;
44  return make_data_member_mapping<
45  S,
50  {"router_id", &S::router_id},
51  {"remote_id", &S::remote_id},
52  {"instance_id", &S::instance_id},
53  {"connect_kind", &S::connect_kind});
54 }
55 //------------------------------------------------------------------------------
61 
64 
67 };
68 
69 template <typename Selector>
70 constexpr auto
71 data_member_mapping(type_identity<bridge_topology_info>, Selector) noexcept {
72  using S = bridge_topology_info;
73  return make_data_member_mapping<
74  S,
78  {"bridge_id", &S::bridge_id},
79  {"opposite_id", &S::opposite_id},
80  {"instance_id", &S::instance_id});
81 }
82 //------------------------------------------------------------------------------
88 
91 };
92 
93 template <typename Selector>
94 constexpr auto
95 data_member_mapping(type_identity<endpoint_topology_info>, Selector) noexcept {
96  using S = endpoint_topology_info;
97  return make_data_member_mapping<S, identifier_t, process_instance_id_t>(
98  {"endpoint_id", &S::endpoint_id}, {"instance_id", &S::instance_id});
99 }
100 //------------------------------------------------------------------------------
104  std::string app_name;
105 
107  std::string display_name;
108 
110  std::string description;
111 
113  bool is_router_node{false};
114 
116  bool is_bridge_node{false};
117 
118  auto tie() const noexcept {
119  return std::tie(
121  }
122 
123  friend auto
124  operator!=(const endpoint_info& l, const endpoint_info& r) noexcept
125  -> bool {
126  return l.tie() != r.tie();
127  }
128 };
129 
130 template <typename Selector>
131 constexpr auto
132 data_member_mapping(type_identity<endpoint_info>, Selector) noexcept {
133  using S = endpoint_info;
134  return make_data_member_mapping<
135  S,
136  std::string,
137  std::string,
138  std::string,
139  bool,
140  bool>(
141  {"app_name", &S::app_name},
142  {"display_name", &S::display_name},
143  {"description", &S::description},
144  {"is_router_node", &S::is_router_node},
145  {"is_bridge_node", &S::is_bridge_node});
146 }
147 //------------------------------------------------------------------------------
148 } // namespace eagine::msgbus
149 
150 #endif // EAGINE_MESSAGE_BUS_TYPES_HPP
process_instance_id_t instance_id
The endpoint process instance id.
Definition: types.hpp:90
identifier_t router_id
The router message bus id.
Definition: types.hpp:28
identifier_t opposite_id
The remote node message bus id.
Definition: types.hpp:63
bool is_router_node
Indicates if the endpoint is a router control node.
Definition: types.hpp:113
Structure holding part of router connection topology information.
Definition: types.hpp:26
identifier_t remote_id
The remote node message bus id.
Definition: types.hpp:31
std::uint32_t process_instance_id_t
Unique process identifier type (does not necessarily match to OS PID).
Definition: identifier_t.hpp:22
@ endpoint_info
The endpoint information has appeared or changed.
std::string app_name
The application name.
Definition: types.hpp:104
process_instance_id_t instance_id
The router process instance id.
Definition: types.hpp:34
std::uint32_t message_sequence_t
Alias for message sequence number type.
Definition: types.hpp:22
bool is_bridge_node
Indicates if the endpoint is a bridge control node.
Definition: types.hpp:116
Message bus endpoint information.
Definition: types.hpp:102
Message bus code is placed in this namespace.
Definition: eagine.hpp:58
identifier_t endpoint_id
The endpoint message bus id.
Definition: types.hpp:87
connection_kind
Message bus connection kind bits enumeration.
Definition: connection_kind.hpp:21
Structure holding part of endpoint connection topology information.
Definition: types.hpp:85
std::string description
User-readable description of the endpoint.
Definition: types.hpp:110
connection_kind connect_kind
The connection kind.
Definition: types.hpp:37
Structure holding part of bridge connection topology information.
Definition: types.hpp:58
std::string display_name
User-readable display name of the endpoint.
Definition: types.hpp:107
std::uint64_t identifier_t
The underlying integer type for eagine::identifier.
Definition: identifier_t.hpp:19
Template type used mostly for function type-tag dispatching.
Definition: type_identity.hpp:19
process_instance_id_t instance_id
The bridge process instance id.
Definition: types.hpp:66
identifier_t bridge_id
The bridge message bus id.
Definition: types.hpp:60

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