Interface for message bus connections. More...
#include <eagine/message_bus/connection.hpp>
Public Types | |
using | fetch_handler = callable_ref< bool(message_id, message_age, const message_view &)> |
Alias for fetch handler callable reference type. | |
Public Member Functions | |
virtual auto | update () -> bool |
Updates the internal state of the connection (called repeatedly). More... | |
virtual void | cleanup () |
Cleans up the connection before destroying it. | |
virtual auto | is_usable () -> bool |
Checks if the connection is in usable state. | |
virtual auto | max_data_size () -> valid_if_positive< span_size_t > |
Returns the maximum data block size in bytes that can be sent. | |
virtual auto | send (message_id msg_id, const message_view &) -> bool=0 |
Sent a message with the specified id. More... | |
virtual auto | fetch_messages (fetch_handler handler) -> bool=0 |
Fetch all enqueued messages that have been received since last fetch. More... | |
![]() | |
virtual auto | kind () -> connection_kind=0 |
Returns the connection kind. | |
virtual auto | addr_kind () -> connection_addr_kind=0 |
Returns the connection address kind. | |
virtual auto | type_id () -> identifier=0 |
Returns a description identifier of the implementation. | |
![]() | |
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 | |
![]() | |
constexpr | interface () noexcept=default |
Default constructible by derived. | |
constexpr | interface (interface &&) noexcept=default |
Move constructible by derived. | |
Interface for message bus connections.
|
pure virtual |
Fetch all enqueued messages that have been received since last fetch.
Implemented in eagine::msgbus::posix_mqueue_connection, eagine::msgbus::direct_server_connection, eagine::msgbus::direct_client_connection, and eagine::msgbus::loopback_connection.
|
pure virtual |
Sent a message with the specified id.
Implemented in eagine::msgbus::posix_mqueue_connection, eagine::msgbus::direct_server_connection, eagine::msgbus::direct_client_connection, and eagine::msgbus::loopback_connection.
|
inlinevirtual |
Updates the internal state of the connection (called repeatedly).
Reimplemented in eagine::msgbus::posix_mqueue_connection, eagine::msgbus::posix_mqueue_connector, and eagine::msgbus::direct_client_connection.