libwreport
2.9
|
Associate a Data Present Bitmap to decoded variables in a subset. More...
#include <internals.h>
Public Member Functions | |
void | reset () |
Resets the object. More... | |
void | init (const Var &bitmap, const Subset &subset, unsigned anchor) |
Initialise the bitmap handler. More... | |
bool | eob () const |
True if there is no bitmap or if the bitmap has been iterated until the end. | |
unsigned | next () |
Return the next variable offset for which the bitmap reports that data is present. | |
Data Fields | |
const Var * | bitmap |
Bitmap being iterated. | |
std::vector< unsigned > | refs |
Arrays of variable indices corresponding to positions in the bitmap where data is present. | |
std::vector< unsigned > ::const_reverse_iterator | iter |
Iterator over refs. More... | |
unsigned | old_anchor |
Anchor point of the first bitmap found since the last reset(). More... | |
Associate a Data Present Bitmap to decoded variables in a subset.
Initialise the bitmap handler.
bitmap | The bitmap |
subset | The subset to which the bitmap refers |
anchor | The index to the first element after the end of the bitmap (usually the C operator that defines or uses the bitmap) |
void wreport::bulletin::Bitmap::reset | ( | ) |
Resets the object.
To be called at start of decoding, to discard all previous leftover context, if any.
std::vector<unsigned>::const_reverse_iterator wreport::bulletin::Bitmap::iter |
Iterator over refs.
Since refs is filled while going backwards over the subset, iteration is done via a reverse_iterator.
unsigned wreport::bulletin::Bitmap::old_anchor |
Anchor point of the first bitmap found since the last reset().
From the specs it looks like bitmaps refer to all data that precedes the C operator that defines or uses them, but from the data samples that we have it look like when multiple bitmaps are present, they always refer to the same set of variables.
For this reason we remember the first anchor point that we see and always refer the other bitmaps that we see to it.