Go to the documentation of this file.
9 #ifndef EAGINE_MESSAGE_BUS_SERVICE_HOST_INFO_HPP
10 #define EAGINE_MESSAGE_BUS_SERVICE_HOST_INFO_HPP
12 #include "../../bool_aggregate.hpp"
13 #include "../../main_ctx.hpp"
14 #include "../../maybe_unused.hpp"
15 #include "../service.hpp"
21 template <
typename Base = subscriber>
22 class host_info_provider :
public Base {
23 using This = host_info_provider;
31 Base::add_method(_host_id(
37 Base::add_method(_hostname(
41 system_info, hostname))[
EAGINE_MSG_ID(eagiSysInf, rqHostname)]);
45 default_function_skeleton<valid_if_positive<host_id_t>() noexcept, 64>
52 template <typename Base = subscriber>
53 class host_info_consumer : public Base {
55 using This = host_info_consumer;
63 Base::add_method(_host_id(
68 Base::add_method(_hostname(
80 virtual void on_host_id_received(
81 const result_context&,
82 valid_if_positive<host_id_t>&&) = 0;
89 virtual void on_hostname_received(
90 const result_context&,
91 valid_if_not_empty<std::string>&&) {}
94 default_callback_invoker<valid_if_positive<host_id_t>(), 32> _host_id;
96 default_callback_invoker<valid_if_not_empty<std::string>(), 1024> _hostname;
101 #endif // EAGINE_MESSAGE_BUS_SERVICE_HOST_INFO_HPP
#define EAGINE_MSG_ID(API, NAME)
Macro for instantiating objects of static_message_id.
Definition: message_id.hpp:148
Message bus code is placed in this namespace.
Definition: eagine.hpp:58
#define EAGINE_THIS_MEM_FUNC_C(FUNC)
Macro for creating object of member_function_constant in member functions.
Definition: mem_func_const.hpp:206
valid_if< T, valid_if_not_empty_policy< T > > valid_if_not_empty
Specialization of valid_if, for values valid if not empty.
Definition: not_empty.hpp:42
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