|
C++ Actor Framework 0.19
|
A default trait type for binary protocols that uses frame as both input and output types and provides async::consumer_resource and async::producer_resource as input_resource and output_resource types, respectively. More...
#include <default_trait.hpp>
Public Types | |
| using | input_type = frame |
| The input type of the application, i.e., what that flows from the socket to the application layer. | |
| using | output_type = frame |
| The output type of the application, i.e., what flows from the application layer to the socket. | |
| using | input_resource = async::consumer_resource< input_type > |
| A resource for consuming input_type elements. | |
| using | output_resource = async::producer_resource< output_type > |
| A resource for producing output_type elements. | |
| using | accept_event = cow_tuple< input_resource, output_resource > |
| An accept event from the server to transmit read and write handles. | |
| using | acceptor_resource = async::consumer_resource< accept_event > |
| A resource for consuming accept events. | |
Public Member Functions | |
| bool | convert (const output_type &x, byte_buffer &bytes) |
| Converts an output element to a byte buffer. | |
| bool | convert (const_byte_span bytes, input_type &x) |
| Converts a byte buffer to an input element. | |
| error | last_error () |
| Returns the last error that occurred. | |
A default trait type for binary protocols that uses frame as both input and output types and provides async::consumer_resource and async::producer_resource as input_resource and output_resource types, respectively.
| bool caf::net::lp::default_trait::convert | ( | const output_type & | x, |
| byte_buffer & | bytes | ||
| ) |
Converts an output element to a byte buffer.
| x | The output element to convert. |
| bytes | The output byte buffer. |
true on success, false otherwise. | bool caf::net::lp::default_trait::convert | ( | const_byte_span | bytes, |
| input_type & | x | ||
| ) |
Converts a byte buffer to an input element.
| bytes | The input byte buffer. |
| x | The output input element. |
true on success, false otherwise.