VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
G::bit_iterator< T > Class Template Reference

A bit-by-bit input iterator that extracts bits in msb-to-lsb order from a sequence of bytes. More...

#include <gbititerator.h>

Public Types

typedef T byte_iterator_type
 

Public Member Functions

 bit_iterator (T bytewise_input_iterator)
 Constructor. Points to the msb of the given byte.
 
unsigned int operator* () const
 Dereference operator, returning one or zero.
 
bit_iteratoroperator++ ()
 Advance operator. Moves from msb to lsb within each byte.
 
bit_iterator operator++ (int)
 Advance operator. Moves from msb to lsb within each byte.
 
bool operator== (const bit_iterator &other) const
 Comparison operator.
 
bool operator!= (const bit_iterator &other) const
 Comparison operator.
 
size_t operator- (const bit_iterator &other) const
 Subtraction operator.
 

Detailed Description

template<typename T>
class G::bit_iterator< T >

A bit-by-bit input iterator that extracts bits in msb-to-lsb order from a sequence of bytes.

Beware of basing bit_iterators on top of istream_iterators because istream iterators can extract from the underlying istream when they are advanced. This means that if the istream lives longer than the iterator then the istream will end up at a poorly-defined position. This bit_iterator implementation tries to delay the use of op++() to avoid this effect, but cannot do so for op==().

Definition at line 42 of file gbititerator.h.


The documentation for this class was generated from the following file: