Go to the documentation of this file.
9 #ifndef EAGINE_MESSAGE_BUS_SERVICE_ENDPOINT_INFO_HPP
10 #define EAGINE_MESSAGE_BUS_SERVICE_ENDPOINT_INFO_HPP
12 #include "../../bool_aggregate.hpp"
13 #include "../../main_ctx.hpp"
14 #include "../../maybe_unused.hpp"
15 #include "../service.hpp"
16 #include "../types.hpp"
22 template <
typename Base = subscriber>
23 class endpoint_info_provider :
public Base {
24 using This = endpoint_info_provider;
32 Base::add_method(_respond(
36 This, _get_endpoint_info))[
EAGINE_MSG_ID(eagiEptInf, request)]);
44 auto result{provide_endpoint_info()};
45 if(result.app_name.empty()) {
54 template <
typename Base = subscriber>
55 class endpoint_info_consumer :
public Base {
57 using This = endpoint_info_consumer;
65 Base::add_method(_info(
69 on_endpoint_info_received))[
EAGINE_MSG_ID(eagiEptInf, response)]);
79 on_endpoint_info_received(
const result_context&, endpoint_info&&) = 0;
87 #endif // EAGINE_MESSAGE_BUS_SERVICE_ENDPOINT_INFO_HPP
#define EAGINE_MSG_ID(API, NAME)
Macro for instantiating objects of static_message_id.
Definition: message_id.hpp:148
@ endpoint_info
The endpoint information has appeared or changed.
Message bus code is placed in this namespace.
Definition: eagine.hpp:58
std::uint64_t identifier_t
The underlying integer type for eagine::identifier.
Definition: identifier_t.hpp:19
auto bus() noexcept -> auto &
Returns a reference to the associated endpoint.
Definition: subscriber.hpp:38
static auto get() noexcept -> main_ctx &
Returns the single instance.
Definition: main_ctx.hpp:64
#define EAGINE_MEM_FUNC_C(CLASS, FUNC)
Macro for creating object of member_function_constant.
Definition: mem_func_const.hpp:186