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

BitMagic-C++

Public Types | Public Member Functions | Static Protected Member Functions | Protected Attributes
bm::bvector< Alloc >::bulk_insert_iterator Class Reference
BitMagic Library » bvector<> container » bvector<> iterators

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

`#include <bm.h>`

Collaboration diagram for bm::bvector< Alloc >::bulk_insert_iterator:
[legend]

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

## Public Member Functions
| bulk_insert_iterator () BMNOEXCEPT
| ~bulk_insert_iterator ()
| bulk_insert_iterator (bvector< Alloc > &bvect, bm::sort_order so=BM_UNKNOWN) BMNOEXCEPT
| bulk_insert_iterator (const bulk_insert_iterator &iit)
| bulk_insert_iterator (const insert_iterator &iit)
| bulk_insert_iterator (bulk_insert_iterator &&iit) BMNOEXCEPT
bulk_insert_iterator & | operator= (const bulk_insert_iterator &ii)
bulk_insert_iterator & | operator= (bulk_insert_iterator &&ii) BMNOEXCEPT
bulk_insert_iterator & | operator= (size_type n)
bulk_insert_iterator & | operator* ()
bulk_insert_iterator & | operator++ ()
bulk_insert_iterator & | operator++ (int)
void | flush ()
bvector_type * | get_bvector () const BMNOEXCEPT

## Static Protected Member Functions
static size_type | buf_size_max () BMNOEXCEPT

## Protected Attributes
bvector_type * | bvect_
| target bvector More...
size_type * | buf_
| bulk insert buffer More...
size_type | buf_size_
| current buffer size More...
bm::sort_order | sorted_
| sort order hint More...

## Detailed Description

### template<class Alloc>
class bm::bvector< Alloc >::bulk_insert_iterator

Output iterator iterator designed to set "ON" bits based on input sequence of integers.

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).

The difference from the canonical insert iterator, is that bulk insert implements internal buffering, which needs to flushed (or flushed automatically when goes out of scope). Buffering creates a delayed effect, which needs to be taken into account.

See also
  insert_iterator

Examples
  sample18.cpp, xsample04.cpp, and xsample04a.cpp.

Definition at line 461 of file bm.h.

## Member Typedef Documentation

## ◆ bvector_type

template<class Alloc >

typedef bm::bvector<Alloc> bm::bvector< Alloc >::bulk_insert_iterator::bvector_type

Definition at line 467 of file bm.h.

## ◆ difference_type

template<class Alloc >

typedef void bm::bvector< Alloc >::bulk_insert_iterator::difference_type

Definition at line 470 of file bm.h.

## ◆ iterator_category

template<class Alloc >

typedef std::output_iterator_tag bm::bvector< Alloc >::bulk_insert_iterator::iterator_category

Definition at line 465 of file bm.h.

## ◆ pointer

template<class Alloc >

typedef void bm::bvector< Alloc >::bulk_insert_iterator::pointer

Definition at line 471 of file bm.h.

## ◆ reference

template<class Alloc >

typedef void bm::bvector< Alloc >::bulk_insert_iterator::reference

Definition at line 472 of file bm.h.

## ◆ size_type

template<class Alloc >

typedef bvector_type::size_type bm::bvector< Alloc >::bulk_insert_iterator::size_type

Definition at line 468 of file bm.h.

## ◆ value_type

template<class Alloc >

typedef bvector_type::size_type bm::bvector< Alloc >::bulk_insert_iterator::value_type

Definition at line 469 of file bm.h.

## Constructor & Destructor Documentation

## ◆ bulk_insert_iterator() [1/5]

template<class Alloc >

bm::bvector< Alloc >::bulk_insert_iterator::bulk_insert_iterator | ( |  | ) |
| inline

Definition at line 474 of file bm.h.

## ◆ ~bulk_insert_iterator()

template<class Alloc >

bm::bvector< Alloc >::bulk_insert_iterator::~bulk_insert_iterator | ( |  | ) |
| inline

Definition at line 477 of file bm.h.

References bm::bvector< Alloc >::bulk_insert_iterator::buf_, bm::bvector< Alloc >::bulk_insert_iterator::bvect_, and bm::bvector< Alloc >::bulk_insert_iterator::flush().

## ◆ bulk_insert_iterator() [2/5]

template<class Alloc >

bm::bvector< Alloc >::bulk_insert_iterator::bulk_insert_iterator | ( | bvector< Alloc > & | bvect,
|  | bm::sort_order | so = `BM_UNKNOWN`
| ) |  |
| inline

Definition at line 484 of file bm.h.

References bm::bvector< Alloc >::bulk_insert_iterator::buf_, bm::bvector< Alloc >::bulk_insert_iterator::buf_size_, bm::bvector< Alloc >::bulk_insert_iterator::bvect_, and bm::bvector< Alloc >::init().

## ◆ bulk_insert_iterator() [3/5]

template<class Alloc >

bm::bvector< Alloc >::bulk_insert_iterator::bulk_insert_iterator | ( | const bulk_insert_iterator & | iit | ) |
| inline

Definition at line 494 of file bm.h.

References bm::bvector< Alloc >::bulk_insert_iterator::buf_, bm::bvector< Alloc >::bulk_insert_iterator::buf_size_, bm::bvector< Alloc >::bulk_insert_iterator::bvect_, and bm::bvector< Alloc >::bulk_insert_iterator::sorted_.

## ◆ bulk_insert_iterator() [4/5]

template<class Alloc >

bm::bvector< Alloc >::bulk_insert_iterator::bulk_insert_iterator | ( | const insert_iterator & | iit | ) |
| inline

Definition at line 503 of file bm.h.

References bm::BM_UNKNOWN, bm::bvector< Alloc >::bulk_insert_iterator::buf_, bm::bvector< Alloc >::bulk_insert_iterator::buf_size_, bm::bvector< Alloc >::bulk_insert_iterator::bvect_, and bm::bvector< Alloc >::bulk_insert_iterator::sorted_.

## ◆ bulk_insert_iterator() [5/5]

template<class Alloc >

bm::bvector< Alloc >::bulk_insert_iterator::bulk_insert_iterator | ( | bulk_insert_iterator && | iit | ) |
| inline

Definition at line 511 of file bm.h.

References bm::bvector< Alloc >::bulk_insert_iterator::buf_, bm::bvector< Alloc >::bulk_insert_iterator::buf_size_, and bm::bvector< Alloc >::bulk_insert_iterator::sorted_.

## Member Function Documentation

## ◆ buf_size_max()

template<class Alloc >

static size_type bm::bvector< Alloc >::bulk_insert_iterator::buf_size_max | ( |  | ) |
| inlinestaticprotected

Definition at line 578 of file bm.h.

References bm::set_block_size.

Referenced by bm::bvector< Alloc >::bulk_insert_iterator::operator=().

## ◆ flush()

template<class Alloc >

void bm::bvector< Alloc >::bulk_insert_iterator::flush | ( |  | ) |
| inline

Flush the internal buffer into target bvector

Examples
  sample18.cpp.

Definition at line 563 of file bm.h.

References BM_ASSERT, bm::bvector< Alloc >::bulk_insert_iterator::buf_, bm::bvector< Alloc >::bulk_insert_iterator::buf_size_, bm::bvector< Alloc >::bulk_insert_iterator::bvect_, bm::bvector< Alloc >::import(), bm::bvector< Alloc >::bulk_insert_iterator::sorted_, and bm::bvector< Alloc >::sync_size().

Referenced by DNA_FingerprintScanner::BuildParallel(), main(), and bm::bvector< Alloc >::bulk_insert_iterator::~bulk_insert_iterator().

## ◆ get_bvector()

template<class Alloc >

bvector_type* bm::bvector< Alloc >::bulk_insert_iterator::get_bvector | ( |  | ) | const
| inline

Definition at line 574 of file bm.h.

References bm::bvector< Alloc >::bulk_insert_iterator::bvect_.

## ◆ operator*()

template<class Alloc >

bulk_insert_iterator& bm::bvector< Alloc >::bulk_insert_iterator::operator* | ( |  | ) |
| inline

Returns *this without doing anything (no-op)

Definition at line 556 of file bm.h.

## ◆ operator++() [1/2]

template<class Alloc >

bulk_insert_iterator& bm::bvector< Alloc >::bulk_insert_iterator::operator++ | ( |  | ) |
| inline

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

Definition at line 558 of file bm.h.

## ◆ operator++() [2/2]

template<class Alloc >

bulk_insert_iterator& bm::bvector< Alloc >::bulk_insert_iterator::operator++ | ( | int |  | ) |
| inline

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

Definition at line 560 of file bm.h.

## ◆ operator=() [1/3]

template<class Alloc >

bulk_insert_iterator& bm::bvector< Alloc >::bulk_insert_iterator::operator= | ( | bulk_insert_iterator && | ii | ) |
| inline

Definition at line 530 of file bm.h.

References bm::bvector< Alloc >::bulk_insert_iterator::buf_, bm::bvector< Alloc >::bulk_insert_iterator::buf_size_, bm::bvector< Alloc >::bulk_insert_iterator::bvect_, and bm::bvector< Alloc >::bulk_insert_iterator::sorted_.

## ◆ operator=() [2/3]

template<class Alloc >

bulk_insert_iterator& bm::bvector< Alloc >::bulk_insert_iterator::operator= | ( | const bulk_insert_iterator & | ii | ) |
| inline

Definition at line 519 of file bm.h.

References bm::bvector< Alloc >::bulk_insert_iterator::buf_, bm::bvector< Alloc >::bulk_insert_iterator::buf_size_, bm::bvector< Alloc >::bulk_insert_iterator::bvect_, and bm::bvector< Alloc >::bulk_insert_iterator::sorted_.

## ◆ operator=() [3/3]

template<class Alloc >

bulk_insert_iterator& bm::bvector< Alloc >::bulk_insert_iterator::operator= | ( | size_type | n | ) |
| inline

Definition at line 541 of file bm.h.

References BM_ASSERT, BM_ASSERT_THROW, bm::bvector< Alloc >::bulk_insert_iterator::buf_, bm::bvector< Alloc >::bulk_insert_iterator::buf_size_, bm::bvector< Alloc >::bulk_insert_iterator::buf_size_max(), bm::bvector< Alloc >::bulk_insert_iterator::bvect_, bm::id_max, bm::bvector< Alloc >::import(), and bm::bvector< Alloc >::bulk_insert_iterator::sorted_.

## Field Documentation

## ◆ buf_

template<class Alloc >

size_type* bm::bvector< Alloc >::bulk_insert_iterator::buf_
| protected

bulk insert buffer

Definition at line 589 of file bm.h.

Referenced by bm::bvector< Alloc >::bulk_insert_iterator::bulk_insert_iterator(), bm::bvector< Alloc >::bulk_insert_iterator::flush(), bm::bvector< Alloc >::bulk_insert_iterator::operator=(), and bm::bvector< Alloc >::bulk_insert_iterator::~bulk_insert_iterator().

## ◆ buf_size_

template<class Alloc >

size_type bm::bvector< Alloc >::bulk_insert_iterator::buf_size_
| protected

current buffer size

Definition at line 590 of file bm.h.

Referenced by bm::bvector< Alloc >::bulk_insert_iterator::bulk_insert_iterator(), bm::bvector< Alloc >::bulk_insert_iterator::flush(), and bm::bvector< Alloc >::bulk_insert_iterator::operator=().

## ◆ bvect_

template<class Alloc >

bvector_type* bm::bvector< Alloc >::bulk_insert_iterator::bvect_
| protected

target bvector

Definition at line 588 of file bm.h.

Referenced by bm::bvector< Alloc >::bulk_insert_iterator::bulk_insert_iterator(), bm::bvector< Alloc >::bulk_insert_iterator::flush(), bm::bvector< Alloc >::bulk_insert_iterator::get_bvector(), bm::bvector< Alloc >::bulk_insert_iterator::operator=(), and bm::bvector< Alloc >::bulk_insert_iterator::~bulk_insert_iterator().

## ◆ sorted_

template<class Alloc >

bm::sort_order bm::bvector< Alloc >::bulk_insert_iterator::sorted_
| protected

sort order hint

Definition at line 591 of file bm.h.

Referenced by bm::bvector< Alloc >::bulk_insert_iterator::bulk_insert_iterator(), bm::bvector< Alloc >::bulk_insert_iterator::flush(), and bm::bvector< Alloc >::bulk_insert_iterator::operator=().

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

- bm.h