|
SatCat5
|
BufferedCopy copies from any Readable source to any Writeable sink.
To use: Pass the source and sink pointers to the constructor. Work is performed during satcat5::poll::service().
Definition at line 66 of file io_buffer.h.
#include <io_buffer.h>
Public Member Functions | |
| BufferedCopy (satcat5::io::Readable *src, satcat5::io::Writeable *dst, satcat5::io::CopyMode mode=CopyMode::PACKET) | |
Create an object that copies data from src to dst. More... | |
| satcat5::io::Writeable * | dst () |
| Other accessors. | |
| satcat5::io::Readable * | src () |
| Other accessors. | |
Protected Member Functions | |
| void | data_rcvd (satcat5::io::Readable *src) override |
| The data_rcvd() callback is polled whenever data is available. More... | |
| void | data_unlink (satcat5::io::Readable *src) override |
| Unlink this EventListener from the designated source, because the designated Readable object is being destroyed. More... | |
Protected Attributes | |
| satcat5::io::Readable * | m_src |
| satcat5::io::Writeable *const | m_dst |
| satcat5::io::CopyMode | m_mode |
| BufferedCopy::BufferedCopy | ( | satcat5::io::Readable * | src, |
| satcat5::io::Writeable * | dst, | ||
| satcat5::io::CopyMode | mode = CopyMode::PACKET |
||
| ) |
Create an object that copies data from src to dst.
In packet mode (default), write_finalize is only called when the input reaches the end of each packet. In stream mode, write_finalize is called every time data is copied.
| src | Data source to be read. |
| dst | Destination to be written. |
| mode | Set operating mode. |
Definition at line 28 of file io_buffer.cc.
|
overrideprotectedvirtual |
The data_rcvd() callback is polled whenever data is available.
A pointer is provided to assist handlers with multiple sources. Child objects of io::EventListener MUST override this method.
Implements satcat5::io::EventListener.
Definition at line 45 of file io_buffer.cc.
|
overrideprotectedvirtual |
Unlink this EventListener from the designated source, because the designated Readable object is being destroyed.
Child objects of io::EventListener MAY override this method if action is required.
Reimplemented from satcat5::io::EventListener.
Definition at line 49 of file io_buffer.cc.