Mantid
Loading...
Searching...
No Matches
OffsetsWorkspace.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 +
7#include <utility>
8
11#include "MantidDataObjects/DllConfig.h"
13
15
16namespace Mantid::DataObjects {
17// Register the workspace
18DECLARE_WORKSPACE(OffsetsWorkspace)
19
20//----------------------------------------------------------------------------------------------
26
27} // namespace Mantid::DataObjects
28
30
31namespace Mantid::Kernel {
32
33template <>
35IPropertyManager::getValue<Mantid::DataObjects::OffsetsWorkspace_sptr>(const std::string &name) const {
36 auto *prop =
37 dynamic_cast<PropertyWithValue<Mantid::DataObjects::OffsetsWorkspace_sptr> *>(getPointerToProperty(name));
38 if (prop) {
39 return *prop;
40 } else {
41 std::string message =
42 "Attempt to assign property " + name + " to incorrect type. Expected shared_ptr<OffsetsWorkspace>.";
43 throw std::runtime_error(message);
44 }
45}
46
47template <>
49IPropertyManager::getValue<Mantid::DataObjects::OffsetsWorkspace_const_sptr>(const std::string &name) const {
50 auto const *prop =
51 dynamic_cast<PropertyWithValue<Mantid::DataObjects::OffsetsWorkspace_sptr> *>(getPointerToProperty(name));
52 if (prop) {
53 return prop->operator()();
54 } else {
55 std::string message =
56 "Attempt to assign property " + name + " to incorrect type. Expected const shared_ptr<OffsetsWorkspace>.";
57 throw std::runtime_error(message);
58 }
59}
60
61} // namespace Mantid::Kernel
62
std::string name
Definition Run.cpp:60
#define DECLARE_WORKSPACE(classname)
An OffsetsWorkspace is a specialized Workspace2D where the Y value at each pixel is the offset to be ...
The concrete, templated class for properties.
std::shared_ptr< const OffsetsWorkspace > OffsetsWorkspace_const_sptr
shared pointer to a const OffsetsWorkspace
std::shared_ptr< OffsetsWorkspace > OffsetsWorkspace_sptr
shared pointer to the OffsetsWorkspace class
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.