bm::rsc_sparse_vector< Val, SV >::back_insert_iterator Class Reference
BitMagic Library » bit-sliced (bitwise transposition) succinct sparse vectors

Back insert iterator implements buffered insert, faster than generic access assignment. More...

`#include <bmsparsevec_compr.h>`

## Public Types

typedef std::output_iterator_tag | iterator_category
typedef rsc_sparse_vector< Val, SV > | rsc_sparse_vector_type
typedef rsc_sparse_vector_type * | rsc_sparse_vector_type_ptr
typedef rsc_sparse_vector_type::value_type | value_type
typedef rsc_sparse_vector_type::size_type | size_type
typedef rsc_sparse_vector_type::bvector_type | bvector_type
typedef void | difference_type
typedef void | pointer
typedef void | reference

## Public Member Functions

back_insert_iterator & | operator= (value_type v)
| push value to the vector
back_insert_iterator & | operator* ()
| noop
back_insert_iterator & | operator++ ()
| noop
back_insert_iterator & | operator++ (int)
| noop
void | add (value_type v)
| add value to the container
void | add_null () BMNOEXCEPT
| add NULL (no-value) to the container
void | add_null (size_type count) BMNOEXCEPT
| add a series of consequitve NULLs (no-value) to the container
void | flush ()
| flush the accumulated buffer
Construction and assignment
| back_insert_iterator () BMNOEXCEPT
| back_insert_iterator (rsc_sparse_vector_type *csv)
| back_insert_iterator (const back_insert_iterator &bi)
void | operator= (const back_insert_iterator &bi)
| ~back_insert_iterator ()

## Protected Types

typedef rsc_sparse_vector_type::sparse_vector_type | sparse_vector_type
| add value to the buffer without changing the NULL vector
typedef sparse_vector_type::back_insert_iterator | sparse_vector_bi

## Detailed Description

template<class Val, class SV>
class bm::rsc_sparse_vector< Val, SV >::back_insert_iterator

Back insert iterator implements buffered insert, faster than generic access assignment.

Limitations for buffered inserter:

1. Do not use more than one inserter per vector at a time
2. Use method flush() at the end to send the rest of accumulated buffer flush is happening automatically on destruction, but if flush produces an exception (for whatever reason) it will be an exception in destructor. As such, explicit flush() is safer way to finilize the sparse vector load.

Definition at line 231 of file bmsparsevec_compr.h.

## Member Typedef Documentation

## bvector_type

template<class Val, class SV>

typedef rsc_sparse_vector_type::bvector_type bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::bvector_type

Definition at line 241 of file bmsparsevec_compr.h.

## difference_type

template<class Val, class SV>

typedef void bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::difference_type

Definition at line 243 of file bmsparsevec_compr.h.

## iterator_category

template<class Val, class SV>

typedef std::output_iterator_tag bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::iterator_category

Definition at line 235 of file bmsparsevec_compr.h.

## pointer

template<class Val, class SV>

typedef void bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::pointer

Definition at line 244 of file bmsparsevec_compr.h.

## reference

template<class Val, class SV>

typedef void bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::reference

Definition at line 245 of file bmsparsevec_compr.h.

## rsc_sparse_vector_type

template<class Val, class SV>

typedef rsc_sparse_vector<Val, SV> bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::rsc_sparse_vector_type

Definition at line 237 of file bmsparsevec_compr.h.

## rsc_sparse_vector_type_ptr

template<class Val, class SV>

typedef rsc_sparse_vector_type* bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::rsc_sparse_vector_type_ptr

Definition at line 238 of file bmsparsevec_compr.h.

## size_type

template<class Val, class SV>

typedef rsc_sparse_vector_type::size_type bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::size_type

Definition at line 240 of file bmsparsevec_compr.h.

## sparse_vector_bi

template<class Val, class SV>

typedef sparse_vector_type::back_insert_iterator bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::sparse_vector_bi

protected

Definition at line 297 of file bmsparsevec_compr.h.

## sparse_vector_type

template<class Val, class SV>

typedef rsc_sparse_vector_type::sparse_vector_type bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::sparse_vector_type

protected

add value to the buffer without changing the NULL vector

Parameters

  v | - value to push back

Returns
  index of added value in the internal buffer size_type add_value(value_type v);

Definition at line 295 of file bmsparsevec_compr.h.

## value_type

template<class Val, class SV>

typedef rsc_sparse_vector_type::value_type bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::value_type

Definition at line 239 of file bmsparsevec_compr.h.

## Constructor & Destructor Documentation

## back_insert_iterator() [1/3]

template<class Val, class SV>

bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::back_insert_iterator | ( |  | ) |

Definition at line 1998 of file bmsparsevec_compr.h.

References BMNOEXCEPT.

Referenced by back_insert_iterator(), bm::rsc_sparse_vector< unsigned, sparse_vector_u32 >::get_back_inserter(), operator*(), operator++(), operator++(), operator=(), and operator=().

## back_insert_iterator() [2/3]

template<class Val, class SV>

bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::back_insert_iterator | ( | rsc_sparse_vector_type * | csv | ) |

Definition at line 2006 of file bmsparsevec_compr.h.

References bm::rsc_sparse_vector< Val, SV >::get_back_inserter().

## back_insert_iterator() [3/3]

template<class Val, class SV>

bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::back_insert_iterator | ( | const back_insert_iterator & | bi | ) |

Definition at line 2017 of file bmsparsevec_compr.h.

References back_insert_iterator().

## ~back_insert_iterator()

template<class Val, class SV>

bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::~back_insert_iterator | ( |  | ) |

Definition at line 2028 of file bmsparsevec_compr.h.

References flush().

## Member Function Documentation

## add()

template<class Val, class SV>

void bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::add | ( | value_type | v | ) |

add value to the container

Definition at line 2036 of file bmsparsevec_compr.h.

References BM_ASSERT, and bm::id_max.

Referenced by operator=().

## add_null() [1/2]

template<class Val, class SV>

void bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::add_null | ( |  | ) |

add NULL (no-value) to the container

Definition at line 2054 of file bmsparsevec_compr.h.

References BM_ASSERT, BMNOEXCEPT, and bm::id_max.

Referenced by add_null().

## add_null() [2/2]

template<class Val, class SV>

void bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::add_null | ( | size_type | count | ) |

add a series of consequitve NULLs (no-value) to the container

References add_null(), and BMNOEXCEPT.

## flush()

template<class Val, class SV>

void bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::flush | ( |  | ) |

flush the accumulated buffer

Definition at line 2078 of file bmsparsevec_compr.h.

Referenced by operator=(), and ~back_insert_iterator().

## operator*()

template<class Val, class SV>

back_insert_iterator & bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::operator* | ( |  | ) |

inline

noop

Definition at line 269 of file bmsparsevec_compr.h.

References back_insert_iterator().

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

template<class Val, class SV>

back_insert_iterator & bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::operator++ | ( |  | ) |

inline

noop

Definition at line 271 of file bmsparsevec_compr.h.

References back_insert_iterator().

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

template<class Val, class SV>

back_insert_iterator & bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::operator++ | ( | int |  | ) |

inline

noop

Definition at line 273 of file bmsparsevec_compr.h.

References back_insert_iterator().

## operator=() [1/2]

template<class Val, class SV>

void bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::operator= | ( | const back_insert_iterator & | bi | ) |

inline

Definition at line 256 of file bmsparsevec_compr.h.

References back_insert_iterator(), BM_ASSERT, and flush().

## operator=() [2/2]

template<class Val, class SV>

back_insert_iterator & bm::rsc_sparse_vector< Val, SV >::back_insert_iterator::operator= | ( | value_type | v | ) |

inline

push value to the vector

Definition at line 266 of file bmsparsevec_compr.h.

References add(), and back_insert_iterator().

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

- bmsparsevec_compr.h