Loopback implementation of connection. Used mainly for testing and development. More...
#include <eagine/message_bus/loopback.hpp>
Public Member Functions | |
| auto | kind () -> connection_kind final |
| Returns the connection kind. | |
| auto | addr_kind () -> connection_addr_kind final |
| Returns the connection address kind. | |
| auto | type_id () -> identifier final |
| Returns a description identifier of the implementation. | |
| auto | send (message_id msg_id, const message_view &message) -> bool final |
| Sent a message with the specified id. More... | |
| auto | fetch_messages (connection::fetch_handler handler) -> bool final |
| Fetch all enqueued messages that have been received since last fetch. More... | |
Public Member Functions inherited from eagine::msgbus::connection | |
| 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. | |
Public Member Functions inherited from eagine::interface< connection_info > | |
| 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 | |
Public Types inherited from eagine::msgbus::connection | |
| using | fetch_handler = callable_ref< bool(message_id, message_age, const message_view &)> |
| Alias for fetch handler callable reference type. | |
Protected Member Functions inherited from eagine::interface< connection_info > | |
| constexpr | interface () noexcept=default |
| Default constructible by derived. | |
| constexpr | interface (interface &&) noexcept=default |
| Move constructible by derived. | |
Loopback implementation of connection. Used mainly for testing and development.
|
inlinefinalvirtual |
Fetch all enqueued messages that have been received since last fetch.
Implements eagine::msgbus::connection.
|
inlinefinalvirtual |
Sent a message with the specified id.
Implements eagine::msgbus::connection.