Mantid
Loading...
Searching...
No Matches
MultiPeriodGroupAlgorithm.cpp
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 +
10
11using namespace Mantid::Kernel;
12
13namespace Mantid::API {
14//----------------------------------------------------------------------------------------------
18
32 if (this->useCustomInputPropertyName()) {
33 const std::string propName = this->fetchInputPropertyName();
34 m_worker.reset(new MultiPeriodGroupWorker(propName));
35 }
36 m_multiPeriodGroups = m_worker->findMultiPeriodGroups(this);
37 bool useDefaultGroupingBehaviour = m_multiPeriodGroups.empty();
38 // Give the opportunity to treat this as a regular group workspace.
39 if (useDefaultGroupingBehaviour) {
40 return Algorithm::checkGroups(); // Delegate to algorithm base class.
41 } else {
42 // Evaluates to True if multiperiod, that way algorithm will call the
43 // overrriden processGroups.
44 return true;
45 }
46}
47
48//--------------------------------------------------------------------------------------------
64
65 bool result = m_worker->processGroups(this, m_multiPeriodGroups);
66 /*
67 * If we could not process the groups as a multiperiod set of groups
68 * workspaces
69 */
70 if (!result) {
71 result = Algorithm::processGroups();
72 }
73
74 return result;
75}
76
77} // namespace Mantid::API
bool m_usingBaseProcessGroups
distinguish between base processGroups() and overriden/algorithm specific versions
Definition: Algorithm.h:463
virtual bool checkGroups()
Check the input workspace properties for groups.
Definition: Algorithm.cpp:1154
virtual bool processGroups()
Process WorkspaceGroup inputs.
Definition: Algorithm.cpp:1365
VecWSGroupType m_multiPeriodGroups
multi period group workspaces.
boost::scoped_ptr< MultiPeriodGroupWorker > m_worker
Multiperiod group worker.
bool checkGroups() override
Overriden from Algorithm base.
bool processGroups() override
Overriden from Algorithm base.
virtual bool useCustomInputPropertyName() const
Method to indicate that a non-standard property is taken as the input, so will be specified via fetch...
virtual std::string fetchInputPropertyName() const =0
Method to provide the name for the input workspace property.
MultiPeriodGroupWorker : Multiperiod group logic relating to determining a valid multiperiod group,...