SatCat5
satcat5::io::MuxDownStatic< SIZE > Class Template Referencefinal

Detailed Description

template<unsigned SIZE>
class satcat5::io::MuxDownStatic< SIZE >

Static allocator for io::MuxDown.

Multiplexer connecting a port to one of several controllers. An example usage is operating a specific UART port in one of several different modes.

Multiplexers for selecting one of several I/O interfaces. We define a "port" as a Readable pointer paired with a Writeable pointer, representing input from and output to the same logical interface. Examples include a UART (cfg::Uart), or a MailMap object (port::Mailbox), or a UDP socket (udp::Socket).

A "controller" is anything that attaches to a port and begins issuing read and write commands, such as an Ethernet network interface (eth::Dispatch) or a port adapter (port::MailAdapter, port::SlipAdapter). Some objects act as both a port and a controller, such as BufferedIO (io::BufferedIO).

Definition at line 123 of file io_multiplexer.h.

#include <io_multiplexer.h>

Inheritance diagram for satcat5::io::MuxDownStatic< SIZE >:
[legend]
Collaboration diagram for satcat5::io::MuxDownStatic< SIZE >:
[legend]

Public Member Functions

 MuxDownStatic (satcat5::io::Readable *src, satcat5::io::Writeable *dst)
 
void select (unsigned idx)
 Select the active controller index, or UINT_MAX for none.
 
satcat5::io::Readableport_rd (unsigned idx)
 Fetch the interface pointer for attaching the Nth controller.
 
satcat5::io::Writeableport_wr (unsigned idx)
 Fetch the interface pointer for attaching the Nth controller.
 

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

const unsigned m_size
 
unsigned m_index
 
satcat5::io::MuxPort *const m_ports
 
satcat5::io::Readablem_src
 
satcat5::io::Writeable *const m_dst
 

Private Attributes

satcat5::io::MuxPort m_port_array [SIZE]
 

Member Function Documentation

◆ data_rcvd()

void MuxDown::data_rcvd ( satcat5::io::Readable src)
overrideprotectedvirtualinherited

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 40 of file io_multiplexer.cc.

◆ data_unlink()

void MuxDown::data_unlink ( satcat5::io::Readable src)
overrideprotectedvirtualinherited

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 45 of file io_multiplexer.cc.


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