Mantid
Loading...
Searching...
No Matches
SpectrumInfoPythonIterator.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
12
13#include <boost/python/iterator.hpp>
14
18using namespace boost::python;
19
20namespace Mantid {
21namespace PythonInterface {
22
43public:
45 : m_begin(spectrumInfo.begin()), m_end(spectrumInfo.end()), m_firstOrDone(true) {}
46
48 if (!m_firstOrDone)
49 ++m_begin;
50 else
51 m_firstOrDone = false;
52 if (m_begin == m_end) {
53 m_firstOrDone = true;
54 objects::stop_iteration_error();
55 }
56 return *m_begin;
57 }
58
59private:
63};
64
65} // namespace PythonInterface
66} // namespace Mantid
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Definition: SpectrumInfo.h:53
const SpectrumInfoItem< SpectrumInfo > & next()
Helper class which provides the Collimation Length for SANS instruments.