Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

__bit_const_iterator Struct Reference

#include <stl_bvector.h>

Inheritance diagram for __bit_const_iterator:

Inheritance graph
[legend]
Collaboration diagram for __bit_const_iterator:

Collaboration graph
[legend]
List of all members.

Public Types

typedef bool reference
typedef bool const_reference
typedef const bool * pointer
typedef __bit_const_iterator const_iterator

Public Methods

void bump_up ()
void bump_down ()
 __bit_const_iterator ()
 __bit_const_iterator (unsigned int *x, unsigned int y)
 __bit_const_iterator (const __bit_iterator &x)
const_reference operator * () const
const_iteratoroperator++ ()
const_iterator operator++ (int)
const_iteratoroperator-- ()
const_iterator operator-- (int)
const_iteratoroperator+= (difference_type i)
const_iteratoroperator-= (difference_type i)
const_iterator operator+ (difference_type i) const
const_iterator operator- (difference_type i) const
difference_type operator- (const_iterator x) const
const_reference operator[] (difference_type i)
bool operator== (const const_iterator &x) const
bool operator!= (const const_iterator &x) const
bool operator< (const_iterator x) const

Public Attributes

unsigned int * p
unsigned int offset

Member Typedef Documentation

typedef __bit_const_iterator __bit_const_iterator::const_iterator
 

Definition at line 158 of file stl_bvector.h.

typedef bool __bit_const_iterator::const_reference
 

Definition at line 156 of file stl_bvector.h.

Referenced by operator *, and operator[].

typedef const bool* __bit_const_iterator::pointer
 

Reimplemented from random_access_iterator< bool, ptrdiff_t >.

Definition at line 157 of file stl_bvector.h.

typedef bool __bit_const_iterator::reference
 

Reimplemented from random_access_iterator< bool, ptrdiff_t >.

Definition at line 155 of file stl_bvector.h.


Constructor & Destructor Documentation

__bit_const_iterator::__bit_const_iterator   [inline]
 

Definition at line 175 of file stl_bvector.h.

References offset, and p.

00175 : p(0), offset(0) {}

__bit_const_iterator::__bit_const_iterator unsigned int *    x,
unsigned int    y
[inline]
 

Definition at line 176 of file stl_bvector.h.

References offset, and p.

00176 : p(x), offset(y) {}

__bit_const_iterator::__bit_const_iterator const __bit_iterator   x [inline]
 

Definition at line 177 of file stl_bvector.h.

References offset, and p.

00177 : p(x.p), offset(x.offset) {}


Member Function Documentation

void __bit_const_iterator::bump_down   [inline]
 

Definition at line 168 of file stl_bvector.h.

References __WORD_BIT, offset, and p.

Referenced by operator--.

00168                    {
00169     if (offset-- == 0) {
00170       offset = __WORD_BIT - 1;
00171       --p;
00172     }
00173   }

void __bit_const_iterator::bump_up   [inline]
 

Definition at line 162 of file stl_bvector.h.

References __WORD_BIT, offset, and p.

Referenced by operator++.

00162                  {
00163     if (offset++ == __WORD_BIT - 1) {
00164       offset = 0;
00165       ++p;
00166     }
00167   }

const_reference __bit_const_iterator::operator *   const [inline]
 

Definition at line 178 of file stl_bvector.h.

References const_reference, offset, and p.

00178                                     {
00179     return __bit_reference(p, 1U << offset);
00180   }

bool __bit_const_iterator::operator!= const const_iterator   x const [inline]
 

Definition at line 231 of file stl_bvector.h.

References offset, and p.

00231                                                  {
00232     return p != x.p || offset != x.offset;
00233   }

const_iterator __bit_const_iterator::operator+ difference_type    i const [inline]
 

Definition at line 214 of file stl_bvector.h.

References random_access_iterator< bool, ptrdiff_t >::difference_type.

00214                                                     {
00215     const_iterator tmp = *this;
00216     return tmp += i;
00217   }

const_iterator __bit_const_iterator::operator++ int    [inline]
 

Definition at line 185 of file stl_bvector.h.

References bump_up.

00185                                  {
00186     const_iterator tmp = *this;
00187     bump_up();
00188     return tmp;
00189   }

const_iterator& __bit_const_iterator::operator++   [inline]
 

Definition at line 181 of file stl_bvector.h.

References bump_up.

00181                                {
00182     bump_up();
00183     return *this;
00184   }

const_iterator& __bit_const_iterator::operator+= difference_type    i [inline]
 

Definition at line 199 of file stl_bvector.h.

References __WORD_BIT, random_access_iterator< bool, ptrdiff_t >::difference_type, offset, and p.

00199                                                 {
00200     difference_type n = i + offset;
00201     p += n / __WORD_BIT;
00202     n = n % __WORD_BIT;
00203     if (n < 0) {
00204       offset = (unsigned int) n + __WORD_BIT;
00205       --p;
00206     } else
00207       offset = (unsigned int) n;
00208     return *this;
00209   }

difference_type __bit_const_iterator::operator- const_iterator    x const [inline]
 

Definition at line 222 of file stl_bvector.h.

References __WORD_BIT, random_access_iterator< bool, ptrdiff_t >::difference_type, offset, and p.

00222                                                     {
00223     return __WORD_BIT * (p - x.p) + offset - x.offset;
00224   }

const_iterator __bit_const_iterator::operator- difference_type    i const [inline]
 

Definition at line 218 of file stl_bvector.h.

References random_access_iterator< bool, ptrdiff_t >::difference_type.

00218                                                     {
00219     const_iterator tmp = *this;
00220     return tmp -= i;
00221   }

const_iterator __bit_const_iterator::operator-- int    [inline]
 

Definition at line 194 of file stl_bvector.h.

References bump_down.

00194                                  {
00195     const_iterator tmp = *this;
00196     bump_down();
00197     return tmp;
00198   }

const_iterator& __bit_const_iterator::operator--   [inline]
 

Definition at line 190 of file stl_bvector.h.

References bump_down.

00190                                {
00191     bump_down();
00192     return *this;
00193   }

const_iterator& __bit_const_iterator::operator-= difference_type    i [inline]
 

Definition at line 210 of file stl_bvector.h.

References random_access_iterator< bool, ptrdiff_t >::difference_type.

00210                                                 {
00211     *this += -i;
00212     return *this;
00213   }

bool __bit_const_iterator::operator< const_iterator    x const [inline]
 

Definition at line 234 of file stl_bvector.h.

References offset, and p.

00234                                          {
00235     return p < x.p || (p == x.p && offset < x.offset);
00236   }

bool __bit_const_iterator::operator== const const_iterator   x const [inline]
 

Definition at line 228 of file stl_bvector.h.

References offset, and p.

00228                                                  {
00229     return p == x.p && offset == x.offset;
00230   }

const_reference __bit_const_iterator::operator[] difference_type    i [inline]
 

Definition at line 225 of file stl_bvector.h.

References const_reference, and random_access_iterator< bool, ptrdiff_t >::difference_type.

00225                                                 { 
00226     return *(*this + i); 
00227   }


Member Data Documentation

unsigned int __bit_const_iterator::offset
 

Definition at line 161 of file stl_bvector.h.

Referenced by __bit_const_iterator, bump_down, bump_up, operator *, operator!=, operator+=, operator-, operator<, and operator==.

unsigned int* __bit_const_iterator::p
 

Definition at line 160 of file stl_bvector.h.

Referenced by __bit_const_iterator, bump_down, bump_up, operator *, operator!=, operator+=, operator-, operator<, and operator==.


The documentation for this struct was generated from the following file:
logo OpenMask

Documentation generated on Thu May 2 15:03:14 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001