10#include <boost/iterator/iterator_facade.hpp>
24template <
typename T,
template <
typename>
class InfoItem>
25class InfoIteratorBase :
public boost::iterator_facade<InfoIteratorBase<T, InfoItem>, InfoItem<T>,
26 boost::random_access_traversal_tag, InfoItem<T>> {
37 if (
index > totalSize)
38 throw std::invalid_argument(
"Iterator start point cannot be greater than maximum size");
46 m_item.m_index = delta < 0 ? std::max(static_cast<uint64_t>(0),
static_cast<uint64_t
>(
m_item.m_index) +
delta)
71 return static_cast<uint64_t
>(other.getIndex()) -
static_cast<uint64_t
>(
getIndex());
std::map< DeltaEMode::Type, std::string > index
void advance(int64_t delta)
bool equal(const InfoIteratorBase< T, InfoItem > &other) const
void setIndex(const size_t index)
InfoItem< T > dereference() const
uint64_t distance_to(const InfoIteratorBase< T, InfoItem > &other) const
friend class boost::iterator_core_access
InfoIteratorBase(T &info, const size_t index, const size_t totalSize)
Constructor for base iterator.
Helper class which provides the Collimation Length for SANS instruments.