BitMagic-C++
bm::bvector< Alloc >::insert_iterator Class Reference

Output iterator iterator designed to set "ON" bits based on input sequence of integers (bit indeces). More...

#include <bm.h>

Collaboration diagram for bm::bvector< Alloc >::insert_iterator:

Public Types

typedef std::output_iterator_tag iterator_category
typedef bm::bvector< Alloc > bvector_type
typedef size_type value_type
typedef void difference_type
typedef void pointer
typedef void reference

Public Member Functions

 insert_iterator () BMNOEXCEPT
 insert_iterator (bvector< Alloc > &bvect) BMNOEXCEPT
 insert_iterator (const insert_iterator &iit)
insert_iteratoroperator= (const insert_iterator &ii)
insert_iteratoroperator= (size_type n)
insert_iteratoroperator* ()
insert_iteratoroperator++ ()
insert_iteratoroperator++ (int)
bvector_typeget_bvector () const

Protected Attributes

bvector_typebvect_
size_type max_bit_

Friends

class bulk_insert_iterator

Detailed Description

template<class Alloc>
class bm::bvector< Alloc >::insert_iterator

Output iterator iterator designed to set "ON" bits based on input sequence of integers (bit indeces).

STL container can be converted to bvector using this iterator Insert iterator guarantees the vector will be dynamically resized (set_bit does not do that).

Note
If you have many bits to set it is a good idea to use output iterator instead of explicitly calling set, because iterator may implement some performance specific tricks to make sure bulk insert is fast.
See also
bulk_insert_iterator
Examples
sample18.cpp.

Definition at line 380 of file bm.h.

Member Typedef Documentation

◆ bvector_type

template<class Alloc>
typedef bm::bvector<Alloc> bm::bvector< Alloc >::insert_iterator::bvector_type

Definition at line 387 of file bm.h.

◆ difference_type

template<class Alloc>
typedef void bm::bvector< Alloc >::insert_iterator::difference_type

Definition at line 389 of file bm.h.

◆ iterator_category

template<class Alloc>
typedef std::output_iterator_tag bm::bvector< Alloc >::insert_iterator::iterator_category

Definition at line 385 of file bm.h.

◆ pointer

template<class Alloc>
typedef void bm::bvector< Alloc >::insert_iterator::pointer

Definition at line 390 of file bm.h.

◆ reference

template<class Alloc>
typedef void bm::bvector< Alloc >::insert_iterator::reference

Definition at line 391 of file bm.h.

◆ value_type

template<class Alloc>
typedef size_type bm::bvector< Alloc >::insert_iterator::value_type

Definition at line 388 of file bm.h.

Constructor & Destructor Documentation

◆ insert_iterator() [1/3]

template<class Alloc>
bm::bvector< Alloc >::insert_iterator::insert_iterator ( )
inline

Definition at line 393 of file bm.h.

References BMNOEXCEPT, bvect_, and max_bit_.

Referenced by insert_iterator(), operator*(), operator++(), operator++(), operator=(), and operator=().

◆ insert_iterator() [2/3]

template<class Alloc>
bm::bvector< Alloc >::insert_iterator::insert_iterator ( bvector< Alloc > & bvect)
inline

Definition at line 395 of file bm.h.

References BMNOEXCEPT, bvect_, and bm::bvector< Alloc >::bvector().

◆ insert_iterator() [3/3]

template<class Alloc>
bm::bvector< Alloc >::insert_iterator::insert_iterator ( const insert_iterator & iit)
inline

Definition at line 402 of file bm.h.

References bvect_, insert_iterator(), and max_bit_.

Member Function Documentation

◆ get_bvector()

template<class Alloc>
bvector_type * bm::bvector< Alloc >::insert_iterator::get_bvector ( ) const
inline

Definition at line 438 of file bm.h.

References bvect_.

◆ operator*()

template<class Alloc>
insert_iterator & bm::bvector< Alloc >::insert_iterator::operator* ( )
inline

Returns *this without doing anything (no-op)

Definition at line 432 of file bm.h.

References insert_iterator().

◆ operator++() [1/2]

template<class Alloc>
insert_iterator & bm::bvector< Alloc >::insert_iterator::operator++ ( )
inline

Returns *this. This iterator does not move (no-op)

Definition at line 434 of file bm.h.

References insert_iterator().

◆ operator++() [2/2]

template<class Alloc>
insert_iterator & bm::bvector< Alloc >::insert_iterator::operator++ ( int )
inline

Returns *this. This iterator does not move (no-op)

Definition at line 436 of file bm.h.

References insert_iterator().

◆ operator=() [1/2]

template<class Alloc>
insert_iterator & bm::bvector< Alloc >::insert_iterator::operator= ( const insert_iterator & ii)
inline

Definition at line 408 of file bm.h.

References bvect_, insert_iterator(), and max_bit_.

◆ operator=() [2/2]

template<class Alloc>
insert_iterator & bm::bvector< Alloc >::insert_iterator::operator= ( size_type n)
inline

Definition at line 414 of file bm.h.

References BM_ASSERT, BM_ASSERT_THROW, bvect_, bm::id_max, insert_iterator(), and max_bit_.

◆ bulk_insert_iterator

template<class Alloc>
friend class bulk_insert_iterator
friend

Definition at line 382 of file bm.h.

References bulk_insert_iterator.

Referenced by bulk_insert_iterator.

Field Documentation

◆ bvect_

template<class Alloc>
bvector_type* bm::bvector< Alloc >::insert_iterator::bvect_
protected

◆ max_bit_

template<class Alloc>
size_type bm::bvector< Alloc >::insert_iterator::max_bit_
protected

Definition at line 442 of file bm.h.

Referenced by insert_iterator(), insert_iterator(), operator=(), and operator=().


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