C++ Actor Framework 0.19
|
Translates between a message-oriented transport and data flows. More...
#include <message_flow_bridge.hpp>
Public Types | |
using | input_type = typename Trait::input_type |
The input type for the application. | |
using | output_type = typename Trait::output_type |
The output type for of application. | |
using | pull_resource_t = async::consumer_resource< output_type > |
The resource type we pull from. We consume the output of the application. | |
using | pull_buffer_t = async::spsc_buffer< output_type > |
The buffer type from the pull_resource_t. | |
using | push_resource_t = async::producer_resource< input_type > |
Type for the producer adapter. We produce the input of the application. | |
using | push_buffer_t = async::spsc_buffer< input_type > |
The buffer type from the push_resource_t. | |
Public Member Functions | |
message_flow_bridge (pull_resource_t in_res, push_resource_t out_res, Trait trait) | |
message_flow_bridge (Trait trait) | |
error | start (net::socket_manager *mgr, lp::lower_layer *down) |
bool | write (const input_type &item) |
void | prepare_send () override |
Gives the upper layer an opportunity to add additional data to the output buffer. | |
bool | done_sending () override |
Queries whether all pending data has been sent. | |
void | abort (const error &reason) override |
Called by the lower layer for cleaning up any state in case of an error or when disposed. | |
ptrdiff_t | consume (byte_span buf) |
Consumes bytes from the lower layer. | |
![]() | |
virtual error | start (lower_layer *down)=0 |
Initializes the upper layer. | |
virtual ptrdiff_t | consume (byte_span payload)=0 |
Consumes bytes from the lower layer. | |
virtual void | prepare_send ()=0 |
Gives the upper layer an opportunity to add additional data to the output buffer. | |
virtual bool | done_sending ()=0 |
Queries whether all pending data has been sent. | |
virtual void | abort (const error &reason)=0 |
Called by the lower layer for cleaning up any state in case of an error or when disposed. | |
Translates between a message-oriented transport and data flows.
The Trait
provides a customization point that converts between native and wire format.
|
overridevirtual |
Called by the lower layer for cleaning up any state in case of an error or when disposed.
Implements caf::net::generic_upper_layer.
|
virtual |
Consumes bytes from the lower layer.
payload | Payload of the received message. |
Implements caf::net::lp::upper_layer.
|
overridevirtual |
Queries whether all pending data has been sent.
The lower calls this function to decide whether it has to wait for write events on the socket.
Implements caf::net::generic_upper_layer.
|
overridevirtual |
Gives the upper layer an opportunity to add additional data to the output buffer.
Implements caf::net::generic_upper_layer.