Mantid
Loading...
Searching...
No Matches
SkippingPolicy.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 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
10#include "MantidDataObjects/DllConfig.h"
11#include <boost/scoped_ptr.hpp>
12
13namespace Mantid {
14namespace DataObjects {
15
21class MANTID_DATAOBJECTS_DLL SkippingPolicy {
22public:
23 virtual bool keepGoing() const = 0;
24 virtual ~SkippingPolicy() = default;
25};
26
28class MANTID_DATAOBJECTS_DLL SkipMaskedBins : public SkippingPolicy {
29private:
31
32public:
33 SkipMaskedBins(Mantid::API::IMDIterator *const iterator) : m_iterator(iterator) {}
38 bool keepGoing() const override { return m_iterator->getIsMasked(); };
39};
40
42class MANTID_DATAOBJECTS_DLL SkipNothing : public SkippingPolicy {
43public:
48 bool keepGoing() const override { return false; }
49};
50
51using SkippingPolicy_scptr = boost::scoped_ptr<SkippingPolicy>;
52
53} // namespace DataObjects
54} // namespace Mantid
This is an interface to an iterator of an IMDWorkspace.
Definition: IMDIterator.h:39
virtual bool getIsMasked() const =0
Returns true if masking is used.
Policy that indicates skipping of masked bins.
Mantid::API::IMDIterator * m_iterator
SkipMaskedBins(Mantid::API::IMDIterator *const iterator)
bool keepGoing() const override
Keep going as long as the current iterator bin is masked.
Policy that indicates no skipping should be applied.
bool keepGoing() const override
Always returns false to cancel skipping.
SkippingPolicy : Policy types for skipping in MDiterators.
virtual bool keepGoing() const =0
boost::scoped_ptr< SkippingPolicy > SkippingPolicy_scptr
Helper class which provides the Collimation Length for SANS instruments.