Alphabetic Class Index   |   Class Inheritance Tree Index   |   Tool Index

Class: SegmentAssembler

This is a base class.

Description:
This class merges Swift UVOT type packets. A group of packets is specified using the bit flags in the CCSDS primary header. Note that although this follows the CCSDS standard, the details of merging are specific to the Swift mission, because they involve handling the secondary and tertiary headers.

This class requires all incoming packets to be unique (i.e. not reuse the same pointer), because it stores the packets while waiting to make a merged group. This class also assumes that all incoming packets have the same APID. It does not assume that the packets are in order. General users will probably want to use a CCSDSMerger instead of using this class directly, since it handles multiple APIDs and makes unique copies of each packet. Note that the output of a SegmentAssembler is not unique (i.e. the same packet is reused over and over).

The merged packets will have a different APID from the segmented packets. This new APID must be specified when constructing the SegmentAssembler.

This class holds a number of "drain pipes" which can be accessed using the scraps(), used(), and duplicates() methods. Only complete groups of packets are merged. Leftover, unmerged packets are sent down the "scraps" drain. If you push in a packet which is the same (i.e. same sequence count and secondary header time) as as a packet waiting to be merged, the original packet will be sent down the "duplicates" drain. All of the packets which comprised complete groups are sent down the "used" drain.

Data Fields
privatestructbefore
privateset<SwiftPacket*,before>pool
privateset<SwiftPacket*,before>::iteratorposition
privateSwiftHead3Packet*merged
privatePacketPipe_scraps
privatePacketPipe_used
privatePacketPipe_duplicates
privateintnew_apid

Constructors / Destructor
public SegmentAssembler(int new_apid)
Constructor.
public ~SegmentAssembler()

Methods
public virtual int poolSize()
public virtual PacketPipe& scraps()
public virtual PacketPipe& used()
public virtual PacketPipe& duplicates()
public virtual SwiftHead3Packet* addPacket(SwiftPacket* p)
Add a packet to the pool, if it makes a complete set, remove that set from the pool and return a merged version of it.
public virtual void flush()
Take all the packets from the pool and send them down the scraps pipe.

Operators


Alphabetic Class Index   |   Class Inheritance Tree Index   |   Tool Index