OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::msgbus::static_subscriber< N > Class Template Reference

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...
 
- Public Member Functions inherited from eagine::msgbus::subscriber_base
 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.
 

Detailed Description

template<std::size_t N>
class eagine::msgbus::static_subscriber< N >

Template for subscribers with predefined count of handled message types.

See also
subscriber

Constructor & Destructor Documentation

◆ static_subscriber()

template<std::size_t N>
template<typename Class , typename... MsgMaps, typename = std::enable_if_t<sizeof...(MsgMaps) == N>>
eagine::msgbus::static_subscriber< N >::static_subscriber ( endpoint bus,
Class *  instance,
MsgMaps...  msg_maps 
)
inline

Construction from a reference to endpoint and some message maps.

See also
endpoint
message_handler_map
EAGINE_MSG_MAP

Member Function Documentation

◆ allow_subscriptions()

template<std::size_t N>
void eagine::msgbus::static_subscriber< N >::allow_subscriptions ( ) const
inline

Sends messages to the router saying which messages should be forwarded.

See also
announce_subscriptions
retract_subscriptions
respond_to_subscription_query

◆ announce_subscriptions()

template<std::size_t N>
void eagine::msgbus::static_subscriber< N >::announce_subscriptions ( ) const
inline

Sends messages to the bus saying which messages this can handle.

See also
retract_subscriptions
respond_to_subscription_query
allow_subscriptions

◆ respond_to_subscription_query() [1/2]

template<std::size_t N>
void eagine::msgbus::static_subscriber< N >::respond_to_subscription_query ( identifier_t  source_id) const
inlinenoexcept

Sends messages responding to a subscription query.

See also
retract_subscriptions
announce_subscriptions

◆ respond_to_subscription_query() [2/2]

template<std::size_t N>
void eagine::msgbus::static_subscriber< N >::respond_to_subscription_query ( identifier_t  source_id,
message_id  sub_msg 
) const
inlinenoexcept

Sends messages responding to a subscription query.

See also
retract_subscriptions
announce_subscriptions

◆ retract_subscriptions()

template<std::size_t N>
void eagine::msgbus::static_subscriber< N >::retract_subscriptions ( ) const
inlinenoexcept

Sends messages to the bus saying which messages this cannot handle.

See also
announce_subscriptions
respond_to_subscription_query
allow_subscriptions

The documentation for this class was generated from the following file:

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).