Sequencer Class Reference
[pydtn]

Sequence number tracker. More...

#include <pydtn/Sequencer.h>

Collaboration diagram for Sequencer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Sequencer ()
 Default constructor.
 Sequencer (const Sequencer &seq)
 Copy constructor; takes ownership of the stragglers.
 ~Sequencer ()
 Destructor.
bool add (uint32_t s)
 Try to add a new sequence number.


Detailed Description

Sequence number tracker.

This is a recursive object. It stores a contiguous range of sequence numbers, as well as a pointer to the next contiguous range. The beginning and end of a range might be the same, which makes this an inefficient way to store single values. As the ranges meet, objects will be merged. If everything is well-behaved, there will only be one Sequencer in the chain. In a realistic scenario, however, this will not be the case. I'm not sure how the worst case compares with an STL list of all the sequence numbers. They might, in fact, be comparable.

Definition at line 53 of file Sequencer.h.


Member Function Documentation

bool Sequencer::add ( uint32_t  s  ) 

Try to add a new sequence number.

Parameters:
s The sequence number being considered
Return values:
true This sequence number has not been seen before
false This is a duplicate

Definition at line 56 of file Sequencer.cc.

References add(), m_first, m_stragglers, m_through, and Sequencer().

Referenced by add().


The documentation for this class was generated from the following files:
Generated on Mon Mar 24 11:15:47 2008 for Pydtn Simulator by  doxygen 1.5.4