|
Open Model Railroad Network (OpenMRN)
|
Stream implementation that allows running a state machine of different streams, typically alternating a header stream and some payload streams. More...
#include <SyncStream.hxx>
Public Member Functions | |
| ssize_t | write (const void *data, size_t len) override |
| Main entry point to the data consumption. | |
Public Member Functions inherited from SyncStream | |
| virtual int | finalize (int status) |
| Called once after all data has been written to close the stream and release resources. | |
| ssize_t | write_all (const void *data, size_t len) |
| Repeatedly writes until all data has been consumed or an error occurs. | |
Protected Member Functions | |
| virtual void | on_eof () |
| This function will be called when the delegate returns EOF. | |
Protected Attributes | |
| std::unique_ptr< SyncStream > | delegate_ |
| Stream implementation to delegate the logic to. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from SyncStream | |
| static const uint8_t * | to_8 (const void *d) |
| Converts a void pointer to an equivalent byte pointer. | |
| static uint8_t * | to_8 (void *d) |
| Converts a void pointer to an equivalent byte pointer. | |
Stream implementation that allows running a state machine of different streams, typically alternating a header stream and some payload streams.
Definition at line 352 of file SyncStream.hxx.
|
inlineprotectedvirtual |
This function will be called when the delegate returns EOF.
Usually used to process something and then set up a new delegate (or clear delegate which will start returning EOF).
Definition at line 380 of file SyncStream.hxx.
|
inlineoverridevirtual |
Main entry point to the data consumption.
| data | is the pointer to a block of data to consume. |
| len | is the number of bytes to consume. |
Implements SyncStream.
Definition at line 355 of file SyncStream.hxx.
|
protected |
Stream implementation to delegate the logic to.
Must be instantiated by the implementation of DelegateStream. If null, then the stream will return EOF to the caller.
Definition at line 389 of file SyncStream.hxx.