Mantid
Loading...
Searching...
No Matches
ClusterRegister.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2014 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
10#include "MantidCrystal/DllConfig.h"
11#include "MantidKernel/System.h"
12#include <boost/scoped_ptr.hpp>
13#include <map>
14#include <memory>
15#include <vector>
16
17namespace Mantid {
18namespace Crystal {
19class ICluster;
20class ImplClusterRegister;
21
25class MANTID_CRYSTAL_DLL ClusterRegister {
26public:
28 using MapCluster = std::map<size_t, std::shared_ptr<ICluster>>;
29
32
34 void add(const size_t &label, const std::shared_ptr<ICluster> &cluster);
35
37 void merge(const DisjointElement &a, const DisjointElement &b) const;
38
40 MapCluster clusters(std::vector<DisjointElement> &elements) const;
41
43 MapCluster clusters() const;
44
47
48private:
50 boost::scoped_ptr<ImplClusterRegister> m_Impl;
51};
52
53} // namespace Crystal
54} // namespace Mantid
ClusterRegister : A fly-weight ICluster regeister.
std::map< size_t, std::shared_ptr< ICluster > > MapCluster
Cluster map.
virtual ~ClusterRegister()
Destructor.
boost::scoped_ptr< ImplClusterRegister > m_Impl
Pointer to implementation.
DisjointElement : Cluster item used in a disjoint-set data structure.
Helper class which provides the Collimation Length for SANS instruments.