Description:
This class reads packets from an istream. The type of each packet is determined by examining the packet's APID, and the packets of different types are routed to different output PacketPipes.
Typical usage would be to create a SwiftTypedPacketReader object, then call the head2(), head3(), uvot(), and ldp() methods to connect the "outlet pipes" to the desired processing plumbing, and then call the pump() method to make everything go.
Instead of calling pump(), you may pull packets from any of the outlet pipes. This causes packets to be read and distributed to the appropriate pipes until a packet comes out of the pipe from which you are pulling.
LDP packets will be of the appropriate type (plain or with checksum) but all LDP packets go to the same output drain.
Embedded Classes:
SwiftTypedPacketReader::Drain
Data Fields | ||
private | Reader* | r |
private | SwiftTypedPacketReader::Drain* | head2_out |
private | SwiftTypedPacketReader::Drain* | uvot_out |
private | SwiftTypedPacketReader::Drain* | head3_out |
private | SwiftTypedPacketReader::Drain* | ldp_out |
private | SwiftTypedPacketReader::Drain* | acs_out |
private | SwiftTypedPacketReader::Drain* | tdrss_out |
private | SwiftTypedPacketReader::Drain* | generic_out |
private | SwiftTypedPacketReader::Drain* | trash_out |
private | CCSDSHead* | head |
private | CCSDSPacket* | generic_p |
private | SwiftPacket* | head2_p |
private | SwiftHead3Packet* | head3_p |
private | LDPPacket* | ldp_p |
private | ChecksumLDPPacket* | checksum_p |
Constructors / Destructor | |
public | SwiftTypedPacketReader(const string& config, istream* in)Constructor. The "first argument is the name of an APIDentifier configuration file, and the second argument is the istream from which to read packets. |
public | ~SwiftTypedPacketReader()Destructor. |
Methods | |||
public | virtual | PacketPipe& | head2() |
public | virtual | PacketPipe& | head3() |
public | virtual | PacketPipe& | uvot() |
public | virtual | PacketPipe& | ldp() |
public | virtual | PacketPipe& | acs() |
public | virtual | PacketPipe& | tdrss() |
public | virtual | PacketPipe& | generic() |
public | virtual | PacketPipe& | trash() |
protected | virtual | CCSDSPacket* | getPacket(int type)Returns a pointer to the packet object corresponding to a given type. |
protected | virtual | SwiftTypedPacketReader::Drain* | getDrain(int type)Returns a pointer to the drain corresponding to a given type. |
public | virtual | void | readPacket()Read a single packet from the istream and send it down the appropriate drain. |
public | virtual | void | pump()Read all available packets from the istream. |
Operators |