Template for subscribers with predefined count of handled message types. More...
#include <eagine/message_bus/subscriber.hpp>
Public Types | |
using | method_handler = typename endpoint::method_handler |
Alias for method/message handler callable reference. | |
Public Member Functions | |
template<typename Class , typename... MsgMaps, typename = std::enable_if_t<sizeof...(MsgMaps) == N>> | |
static_subscriber (endpoint &bus, Class *instance, MsgMaps... msg_maps) | |
Construction from a reference to endpoint and some message maps. More... | |
static_subscriber (static_subscriber &&temp)=delete | |
Not move constructible. | |
static_subscriber (const static_subscriber &)=delete | |
Not copy constructible. | |
auto | operator= (static_subscriber &&)=delete |
Not move assignable. | |
auto | operator= (const static_subscriber &)=delete |
Not copy assignable. | |
auto | process_one () -> bool |
Processes one pending enqueued message. | |
auto | process_all () -> span_size_t |
Processes all pending enqueued messages. | |
void | announce_subscriptions () const |
Sends messages to the bus saying which messages this can handle. More... | |
void | allow_subscriptions () const |
Sends messages to the router saying which messages should be forwarded. More... | |
void | retract_subscriptions () const noexcept |
Sends messages to the bus saying which messages this cannot handle. More... | |
void | respond_to_subscription_query (identifier_t source_id) const noexcept |
Sends messages responding to a subscription query. More... | |
void | respond_to_subscription_query (identifier_t source_id, message_id sub_msg) const noexcept |
Sends messages responding to a subscription query. More... | |
![]() | |
operator bool () noexcept | |
Tests if this subscribes has an associated endpoint and is usable. | |
auto | bus () noexcept -> auto & |
Returns a reference to the associated endpoint. More... | |
auto | bus () const noexcept -> auto & |
Returns a const reference to the associated endpoint. More... | |
auto | update () const noexcept -> bool |
Updates the internal endpoint state (should be called repeatedly). | |
auto | verify_bits (const stored_message &message) noexcept -> verification_bits |
Uses the associated endpoint to verify the specified message. | |
void | query_subscriptions_of (identifier_t target_id) |
Queries the subscriptions of the remote endpoint with the specified id. More... | |
void | query_subscribers_of (message_id sub_msg) |
Queries remote nodes subscribing to the specified message. More... | |
subscriber_base (const subscriber_base &)=delete | |
Not copy assignable. | |
auto | operator= (subscriber_base &&)=delete |
Not move assignable. | |
auto | operator= (const subscriber_base &)=delete |
Not copy constructible. | |
Template for subscribers with predefined count of handled message types.
|
inline |
Construction from a reference to endpoint and some message maps.
|
inline |
Sends messages to the router saying which messages should be forwarded.
|
inline |
Sends messages to the bus saying which messages this can handle.
|
inlinenoexcept |
Sends messages responding to a subscription query.
|
inlinenoexcept |
Sends messages responding to a subscription query.
|
inlinenoexcept |
Sends messages to the bus saying which messages this cannot handle.