Mantid
Loading...
Searching...
No Matches
SampleEnvironmentSpec.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2016 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
9#include "MantidDataHandling/DllConfig.h"
12
13#include <string>
14#include <unordered_map>
15#include <vector>
16
17namespace Mantid {
18namespace DataHandling {
19
26class MANTID_DATAHANDLING_DLL SampleEnvironmentSpec {
27public:
28 // Convenience typedefs
29 using ContainerIndex = std::unordered_map<std::string, Geometry::Container_const_sptr>;
30 using ComponentList = std::vector<Geometry::IObject_const_sptr>;
31
32 SampleEnvironmentSpec(std::string name);
33
35 inline const std::string &name() const { return m_name; }
37 inline size_t ncans() const { return m_cans.size(); }
39 inline size_t ncomponents() const { return m_components.size(); }
40 Geometry::Container_const_sptr findContainer(const std::string &id) const;
41
42 Geometry::SampleEnvironment_uptr buildEnvironment(const std::string &canID) const;
43
44 void addContainer(const Geometry::Container_const_sptr &can);
45 void addComponent(const Geometry::IObject_const_sptr &component);
46
47private:
48 std::string m_name;
51};
52
54using SampleEnvironmentSpec_uptr = std::unique_ptr<SampleEnvironmentSpec>;
56using SampleEnvironmentSpec_const_uptr = std::unique_ptr<const SampleEnvironmentSpec>;
57
58} // namespace DataHandling
59} // namespace Mantid
Defines the properties of a named SampleEnvironment setup.
std::vector< Geometry::IObject_const_sptr > ComponentList
std::unordered_map< std::string, Geometry::Container_const_sptr > ContainerIndex
std::unique_ptr< SampleEnvironmentSpec > SampleEnvironmentSpec_uptr
unique_ptr to a SampleEnvironmentSpec
std::unique_ptr< const SampleEnvironmentSpec > SampleEnvironmentSpec_const_uptr
unique_ptr to a const SampleEnvironmentSpec
std::shared_ptr< const Container > Container_const_sptr
Typdef for a shared pointer to a const object.
Definition: Container.h:107
std::unique_ptr< SampleEnvironment > SampleEnvironment_uptr
std::shared_ptr< const IObject > IObject_const_sptr
Typdef for a shared pointer to a const object.
Definition: IObject.h:94
Helper class which provides the Collimation Length for SANS instruments.