-
Nick Draper authored
Also updated class_maker.py
Nick Draper authoredAlso updated class_maker.py
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
HistoWorkspace.h 1.56 KiB
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2016 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidAPI/DllConfig.h"
#include "MantidAPI/MatrixWorkspace.h"
namespace Mantid {
namespace API {
/** HistoWorkspace is an abstract base class for MatrixWorkspace types that are
NOT event workspaces. This type has to exist as a helper for workspace
creation: Many algorithms create a new MatrixWorkspace from a parent workspace
without keeping the events, but keeping any potential sub type of
MatrixWorkspace. HistoWorkspace provides a common base type for all non-event
MatrixWorkspaces. See DataObjects/WorkspaceCreation.h for mor details.
*/
class MANTID_API_DLL HistoWorkspace : public MatrixWorkspace {
public:
HistoWorkspace(
const Parallel::StorageMode storageMode = Parallel::StorageMode::Cloned)
: MatrixWorkspace(storageMode) {}
/// Returns a clone of the workspace
std::unique_ptr<HistoWorkspace> clone() const {
return std::unique_ptr<HistoWorkspace>(doClone());
}
/// Returns a default-initialized clone of the workspace
std::unique_ptr<HistoWorkspace> cloneEmpty() const {
return std::unique_ptr<HistoWorkspace>(doCloneEmpty());
}
private:
HistoWorkspace *doClone() const override = 0;
HistoWorkspace *doCloneEmpty() const override = 0;
};
} // namespace API
} // namespace Mantid