SatCat5
satcat5::io::BufferedCopy Class Referencefinal

Detailed Description

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>

Inheritance diagram for satcat5::io::BufferedCopy:
[legend]
Collaboration diagram for satcat5::io::BufferedCopy:
[legend]

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::Writeabledst ()
 Other accessors.
 
satcat5::io::Readablesrc ()
 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::Readablem_src
 
satcat5::io::Writeable *const m_dst
 
satcat5::io::CopyMode m_mode
 

Constructor & Destructor Documentation

◆ BufferedCopy()

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.

Parameters
srcData source to be read.
dstDestination to be written.
modeSet operating mode.
See also
CopyMode.

Definition at line 28 of file io_buffer.cc.

Member Function Documentation

◆ data_rcvd()

void BufferedCopy::data_rcvd ( satcat5::io::Readable src)
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.

◆ data_unlink()

void BufferedCopy::data_unlink ( satcat5::io::Readable src)
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.


The documentation for this class was generated from the following files: