Go to the documentation of this file.
9 #ifndef EAGINE_MESSAGE_BUS_ROUTER_ADDRESS_HPP
10 #define EAGINE_MESSAGE_BUS_ROUTER_ADDRESS_HPP
12 #include "../application_config.hpp"
13 #include "../main_ctx_object.hpp"
25 if(
app_config().fetch(
"msg_bus.router.address", _addrs)) {
26 log_debug(
"configured router address(es) ${addr}")
28 for(
auto& addr : _addrs) {
37 explicit operator bool() const noexcept {
38 return !_addrs.empty();
46 return {_addrs.
front()};
56 return _addrs.cbegin();
60 auto end() const noexcept {
65 std::vector<std::string> _addrs{};
70 #endif // EAGINE_MESSAGE_BUS_ROUTER_ADDRESS_HPP
auto log_debug(string_view format) noexcept
Create a log message entry for debugging, with specified format.
Definition: logger.hpp:341
Helper class used to initialize main context objects.
Definition: main_ctx_object.hpp:45
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
#define EAGINE_ID(NAME)
Macro for constructing instances of eagine::identifier.
Definition: identifier.hpp:353
static constexpr auto span_size(T v) noexcept
Converts argument to span size type.
Definition: types.hpp:59
Base class for main context objects.
Definition: main_ctx_object.hpp:71
basic_address< false > address
Type alias for non-const memory address values.
Definition: address.hpp:203
auto backend() noexcept
Returns a pointer to the backend of this logger object.
Definition: logger.hpp:55
auto count() const noexcept -> span_size_t
Returns the number of addresses stored in this instance.
Definition: router_address.hpp:50
router_address(main_ctx_parent parent)
Construction from parent main context object.
Definition: router_address.hpp:23
auto begin() const noexcept
Returns a const iterator to the start of the range of addresses.
Definition: router_address.hpp:55
Message bus code is placed in this namespace.
Definition: eagine.hpp:58
auto app_config() const noexcept -> application_config &
Returns a reference to the application config object.
Class loading and managing message bus router address(es).
Definition: router_address.hpp:20
Interface for logging backend implementations.
Definition: backend.hpp:60
auto end() const noexcept
Returns a const iterator past the end of the range of addresses.
Definition: router_address.hpp:60
auto front() const noexcept -> const value_type &
Returns a const reference to value at the front of the span.
Definition: span.hpp:338