25#ifndef __BITPIT_PIERCED_KERNEL_ITERATOR_TPP__
26#define __BITPIT_PIERCED_KERNEL_ITERATOR_TPP__
33template<
typename id_t>
35 : m_kernel(nullptr), m_pos(0)
43template<
typename id_t>
45 : m_kernel(kernel), m_pos(pos)
55template<
typename id_t>
58 std::swap(m_kernel, other.m_kernel);
59 std::swap(m_pos, other.m_pos);
67template<
typename id_t>
79template<
typename id_t>
83 if (m_pos >= m_kernel->m_end_pos) {
88 id = m_kernel->m_ids[m_pos];
102template<
typename id_t>
113template<
typename id_t>
126template<
typename id_t>
129 if (m_pos >= m_kernel->m_end_pos) {
133 auto basePosItr = m_kernel->m_ids.begin();
134 auto endPosItr = basePosItr + m_kernel->m_end_pos;
135 auto currentPosItr = basePosItr + m_pos + 1;
137 while (currentPosItr < endPosItr) {
138 id_t
id = *currentPosItr;
146 m_pos = currentPosItr - basePosItr;
158template<
typename id_t>
175template<
typename id_t>
178 if (m_pos <= m_kernel->m_begin_pos) {
182 auto basePosItr = m_kernel->m_ids.begin();
183 auto beginPosItr = basePosItr + m_kernel->m_begin_pos;
184 auto currentPosItr = basePosItr + m_pos - 1;
186 while (currentPosItr > beginPosItr) {
187 id_t
id = *currentPosItr;
195 m_pos = currentPosItr - basePosItr;
207template<
typename id_t>
222template<
typename id_t>
225 return m_kernel->m_ids[m_pos];
233template<
typename id_t>
236 return m_kernel->m_ids[m_pos];
Iterator for the class PiercedKernel.
const id_t * operator->() const
void swap(PiercedKernelIterator &other) noexcept
std::size_t getPos() const noexcept
PiercedKernelIterator & operator++()
std::size_t getRawIndex() const noexcept
PiercedKernelIterator & operator--()
id_t getId(const id_t &fallback=-1) const noexcept
const id_t & operator*() const
const kernel_type & getKernel() const
Metafunction for generating a pierced kernel.