Mantid
Loading...
Searching...
No Matches
SurfaceFactory.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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
9namespace Mantid {
10
11namespace Geometry {
12
26class MANTID_GEOMETRY_DLL SurfaceFactory {
27private:
28 // workaround because gcc 4.4 cannot have std::unique_ptr inside a std::map.
29 // http://stackoverflow.com/questions/7342703/gcc-4-4-4-5-unique-ptr-not-work-for-unordered-set-unordered-map
30
32 using MapType = std::vector<std::pair<std::string, std::unique_ptr<Surface>>>;
33
35
37 std::map<char, std::string> ID;
38 SurfaceFactory(const SurfaceFactory &other);
39 SurfaceFactory &operator=(const SurfaceFactory &other);
41 void registerSurface();
42
43public:
44 static SurfaceFactory *Instance();
45
46 std::unique_ptr<Surface> createSurface(const std::string &) const;
47 std::unique_ptr<Surface> createSurfaceID(const std::string &) const;
48 std::unique_ptr<Surface> processLine(const std::string &) const;
49};
50
51} // NAMESPACE Geometry
52
53} // NAMESPACE Mantid
Creates instances of Surfaces.
std::map< char, std::string > ID
Short letter identifiers.
std::vector< std::pair< std::string, std::unique_ptr< Surface > > > MapType
< Storage of surface pointers.
MapType SGrid
The tally stack.
static SurfaceFactory * FOBJ
Effective "this".
Helper class which provides the Collimation Length for SANS instruments.