"...inc/git@code.ornl.gov:mantidproject/mantid.git" did not exist on "490c91029a824ca4b14f2727611c5a116f9f1bba"
Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef MANTID_GEOMETRY_DETECTORINFOPYTHONITERATOR_H_
#define MANTID_GEOMETRY_DETECTORINFOPYTHONITERATOR_H_
#include <boost/python/class.hpp>
#include <boost/python/copy_const_reference.hpp>
#include <boost/python/def.hpp>
#include <boost/python/iterator.hpp>
#include <boost/python/module.hpp>
#include <boost/python/reference_existing_object.hpp>
#include "MantidGeometry/Instrument/DetectorInfo.h"
#include "MantidGeometry/Instrument/DetectorInfoItem.h"
#include "MantidGeometry/Instrument/DetectorInfoIterator.h"
using Mantid::Geometry::DetectorInfo;
using Mantid::Geometry::DetectorInfoItem;
using Mantid::Geometry::DetectorInfoIterator;
using namespace boost::python;
namespace Mantid {
namespace Geometry {
class DetectorInfoPythonIterator {
public:
explicit DetectorInfoPythonIterator(const DetectorInfo &source)
: m_begin(source.begin()), m_end(source.end()), m_current(*m_begin) {}
const DetectorInfoItem &next() {
if (m_begin == m_end) {
objects::stop_iteration_error();
}
m_current = *m_begin++;
return m_current;
}
private:
DetectorInfoIterator m_begin;
DetectorInfoIterator m_end;
DetectorInfoItem m_current;
};
} // namespace Geometry
} // namespace Mantid
#endif /* MANTID_GEOMETRY_DETECTORINFOPYTHONITERATOR_H_ */