Helper mixin class for message bus services composed of several parts. More...
#include <eagine/message_bus/service.hpp>
Public Member Functions | |
service_composition (endpoint &bus) | |
Construction from a reference to an endpoint. | |
service_composition (service_composition &&that) | |
Move constructible. | |
service_composition (const service_composition &)=delete | |
Not copy constructible. | |
auto | operator= (service_composition &&)=delete |
Not move assignable. | |
auto | operator= (const service_composition &)=delete |
Not copy assignable. | |
auto | add_connection (std::unique_ptr< connection > conn) -> bool final |
Adds a connection to the associated endpoint. | |
auto | update_and_process_all () -> bool final |
Updates the associated endpoint and processes all incoming messages. | |
![]() | |
subscriber (endpoint &bus) noexcept | |
Construction from a reference to endpoint. | |
template<typename Class , bool(Class::*)(const message_context &, stored_message &) Method> | |
void | add_method (Class *instance, message_id msg_id, member_function_constant< bool(Class::*)(const message_context &, stored_message &), Method > method) |
Adds a handler for messages with the specified message id. | |
template<typename Class , bool(Class::*)(const message_context &, stored_message &) Method> | |
void | add_method (Class *instance, message_handler_map< member_function_constant< bool(Class::*)(const message_context &, stored_message &), Method >> msg_map) noexcept |
Adds a handler for messages with the specified message id. | |
template<typename Class , bool(Class::*)(const message_context &, stored_message &) Method> | |
void | add_method (std::tuple< Class *, message_handler_map< member_function_constant< bool(Class::*)(const message_context &, stored_message &), Method >>> imm) noexcept |
Adds a handler for messages with the specified message id. | |
template<typename Class , bool(Class::*)(const message_context &, stored_message &) Method, identifier_t ClassId, identifier_t MethodId> | |
void | add_method (Class *instance, static_message_handler_map< static_message_id< ClassId, MethodId >, member_function_constant< bool(Class::*)(const message_context &, stored_message &), Method >> msg_map) noexcept |
Adds a handler for messages with the specified message id. | |
auto | process_one () -> bool |
Handles (and removes) one of poending received messages. More... | |
auto | process_all () -> span_size_t |
Handles (and removes) all poending received messages. More... | |
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... | |
![]() | |
constexpr | interface (const interface &)=delete |
Not copyable. | |
auto | operator= (interface &&)=delete |
Not move assignable. | |
auto | operator= (const interface &)=delete |
Not copy assignable. | |
![]() | |
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. | |
![]() | |
constexpr | interface (const interface &)=delete |
Not copyable. | |
auto | operator= (interface &&)=delete |
Not move assignable. | |
auto | operator= (const interface &)=delete |
Not copy assignable. | |
![]() | |
constexpr | interface (const interface &)=delete |
Not copyable. | |
auto | operator= (interface &&)=delete |
Not move assignable. | |
auto | operator= (const interface &)=delete |
Not copy assignable. | |
Additional Inherited Members | |
![]() | |
using | method_handler = callable_ref< bool(const message_context &, stored_message &)> |
Alias for method/message handler callable reference. | |
![]() | |
constexpr | interface () noexcept=default |
Default constructible by derived. | |
constexpr | interface (interface &&) noexcept=default |
Move constructible by derived. | |
![]() | |
constexpr | interface () noexcept=default |
Default constructible by derived. | |
constexpr | interface (interface &&) noexcept=default |
Move constructible by derived. | |
![]() | |
constexpr | interface () noexcept=default |
Default constructible by derived. | |
constexpr | interface (interface &&) noexcept=default |
Move constructible by derived. | |
Helper mixin class for message bus services composed of several parts.