Alphabetic Class Index   |   Class Inheritance Tree Index   |   Tool Index

Class: PacketTank

Parent class: PacketPipe

Description:
This is a tank for storing packets. If you push a packet in, it is held in an STL deque container and doesn't come out the other side. If you pull a packet out, it removes the first packet from the tank and delivers it. If there are no packets in the tank, it tries to pull one from upstream. Therefore a tank can act as a buffer if input and output are not synchronized for some reason.

Probably the most important use of a tank is for sorting or uniquing packets. To do this you first fill the tank, then call the sort() and/or keepLastUnique() methods, then drain the tank.

The container() method gives you direct access to the undelying deque if you need to do something realy fancy to the collected packets.

Data Fields
privatedeque<CCSDSPacket*>*tank
privateintunique_packets

Constructors / Destructor
public PacketTank()
Constructor.

Methods
public virtual
constant
deque* container()
public virtual int hints()
Returns the hints flag for the output packet stream.
public virtual void hints(int)
public virtual void sort()
Stable sort the packets into their natural order. This method is just a way of simplifying the underlying STL syntax.
public virtual void keepLastUnique(PacketPipe* drain = NULL)
public virtual void pushIn(CCSDSPacket* p)
Put a packet into the tank, specifically insert it at the end of the container.
public virtual CCSDSPacket* pullOut()
Pull a packet out of the "bottom" of the tank. if the tank is empty, then just pull a packet from upstream, like a plain PacketPipe.
public virtual void pump()
This method overrides the generic PacketPipe method to do nothing.

Operators


Alphabetic Class Index   |   Class Inheritance Tree Index   |   Tool Index