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
12
14
15namespace Mantid::DataObjects {
16// Register the workspace
17DECLARE_WORKSPACE(OffsetsWorkspace)
18
19//----------------------------------------------------------------------------------------------
25
26} // namespace Mantid::DataObjects
27
29
30namespace Mantid::Kernel {
31
32template <>
34IPropertyManager::getValue<Mantid::DataObjects::OffsetsWorkspace_sptr>(const std::string &name) const {
35 auto *prop =
36 dynamic_cast<PropertyWithValue<Mantid::DataObjects::OffsetsWorkspace_sptr> *>(getPointerToProperty(name));
37 if (prop) {
38 return *prop;
39 } else {
40 std::string message =
41 "Attempt to assign property " + name + " to incorrect type. Expected shared_ptr<OffsetsWorkspace>.";
42 throw std::runtime_error(message);
43 }
44}
45
46template <>
48IPropertyManager::getValue<Mantid::DataObjects::OffsetsWorkspace_const_sptr>(const std::string &name) const {
49 auto const *prop =
50 dynamic_cast<PropertyWithValue<Mantid::DataObjects::OffsetsWorkspace_sptr> *>(getPointerToProperty(name));
51 if (prop) {
52 return prop->operator()();
53 } else {
54 std::string message =
55 "Attempt to assign property " + name + " to incorrect type. Expected const shared_ptr<OffsetsWorkspace>.";
56 throw std::runtime_error(message);
57 }
58}
59
60} // namespace Mantid::Kernel
61
std::string name
Definition Run.cpp:60
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition System.h:37
#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.