DataBlockGenerator.h 1.08 KB
Newer Older
1
2
3
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2016 ISIS Rutherford Appleton Laboratory UKRI,
4
5
//   NScD Oak Ridge National Laboratory, European Spallation Source,
//   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#pragma once
8

9
#include "MantidDataHandling/DataBlock.h"
10
#include <boost/optional.hpp>
11
12
13
14
15
16

namespace Mantid {
namespace DataHandling {

class DataBlock;

17
18
19
20
/** DataBlockGenerator: The DataBlockGenerator class provides increasing
    int64_t numbers from a collection of intervals which are being input
    into the generator at construction.
*/
21
22
class DLLExport DataBlockGenerator {
public:
23
  DataBlockGenerator(const std::vector<spectrumPair> &intervals);
24
  class DataBlock;
25
  DataBlockGenerator &operator++();
26
  DataBlockGenerator operator++(int);
27
  bool isDone();
Stephen's avatar
Stephen committed
28
  specnum_t getValue();
29
  void next();
30

31
public:
32
  std::vector<spectrumPair> m_intervals;
Stephen's avatar
Stephen committed
33
  specnum_t m_currentSpectrum;
34
35

  boost::optional<size_t> m_currentIntervalIndex;
36
37
38
39
};

} // namespace DataHandling
} // namespace Mantid