|
Open Model Railroad Network (OpenMRN)
|
Stream implementation that takes a fixed number of bytes, filling in a header structure, and then returns EOF. More...
#include <SyncStream.hxx>
Public Member Functions | |
| HeaderStream (void *header, size_t header_size) | |
| 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. | |
Private Attributes | |
| uint8_t * | data_ |
| Pointer where we need to save the incoming bytes. | |
| size_t | remaining_ |
| How many bytes we still need to save. | |
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 takes a fixed number of bytes, filling in a header structure, and then returns EOF.
Definition at line 113 of file SyncStream.hxx.
|
inline |
Definition at line 116 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 122 of file SyncStream.hxx.
|
private |
Pointer where we need to save the incoming bytes.
Definition at line 140 of file SyncStream.hxx.
|
private |
How many bytes we still need to save.
Definition at line 142 of file SyncStream.hxx.