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

eagine::msgbus::loopback_connection Class Reference

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.
 

Detailed Description

Loopback implementation of connection. Used mainly for testing and development.

Member Function Documentation

◆ fetch_messages()

auto eagine::msgbus::loopback_connection::fetch_messages ( connection::fetch_handler  handler) -> bool
inlinefinalvirtual

Fetch all enqueued messages that have been received since last fetch.

See also
send
update

Implements eagine::msgbus::connection.

◆ send()

auto eagine::msgbus::loopback_connection::send ( message_id  msg_id,
const message_view  
) -> bool
inlinefinalvirtual

Sent a message with the specified id.

See also
fetch_messages
update

Implements eagine::msgbus::connection.


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).