Description:
This class contains a number of SegmentAssembler objects in order to merge a stream of Swift UVOT-style packets containing multiple APIDs.
Unlike SegmentAssembler, this class is a PacketPipe. You may push segmented packets in and merged packets will come out the other end. You can also pull them out, but it is more efficient to push them in.
After creating a CCSDSMerger, you have to call the setNewAPID() method to teach the merger what merged packet APIDs correspond to which segmented packet APIDs.
This class has the same drain pipes as SegmentAssembler. Each of these pipes collects the outflow from the coresponding drain pipe of all the SegmentAssembler classes.
Data Fields | ||
private | map<int,SegmentAssembler*> | assemblers |
private | map<int,int> | apid_map |
private | int | unique_packets |
private | PacketTee | _scraps |
private | PacketTee | _used |
private | PacketTee | _duplicates |
Constructors / Destructor | |
public | CCSDSMerger()Constructor. |
public | ~CCSDSMerger() |
Methods | |||
public | SegmentAssembler* | getAssembler(int apid)Get the holding tank of packets waiting to be merged for a given apid. | |
public | virtual | int | newAPID(int old_apid)Returns the merged packet APID corresponding to a given segmented packet APID. |
public | virtual | void | setNewAPID(int old_apid, int new_apid)This method tells the CCSDSMerger about a mapping between a segmented APID and the APID of the corresponding merged packets. By default the merged packet APID is the same as the segmented packet APID. |
public | virtual | void | hints(int) |
public | virtual | PacketPipe& | scraps() |
public | virtual | PacketPipe& | used() |
public | virtual | PacketPipe& | duplicates() |
public | virtual | CCSDSPacket* | addPacket(CCSDSPacket* generic_p)Put a segmented packet into the appropriate assembler and return anything which pops out. |
public | virtual | void | pushIn(CCSDSPacket* p)Put a segmented packet into the merger. |
public | virtual | CCSDSPacket* | pullOut()Pull out a merged packet. Note it is more natural to push packets in than pull them out. |
private | virtual | void | flushScraps()Flush the scraps from all the assemblers. |
Operators |