Mantid
Loading...
Searching...
No Matches
WriteLock.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 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 "MantidKernel/DllConfig.h"
10
11#include <cstddef>
12
13namespace Mantid {
14namespace Kernel {
15//---------------------------------------------------------------------------
16// Forward Declarations
17//---------------------------------------------------------------------------
18class DataItem;
19
43class MANTID_KERNEL_DLL WriteLock {
44public:
45 WriteLock(const DataItem &item);
46 WriteLock(const WriteLock &) = delete;
47 WriteLock &operator=(const WriteLock &) = delete;
48 virtual ~WriteLock();
49
50private:
52 void *operator new(std::size_t);
54 void *operator new[](std::size_t);
55
58};
59
60} // namespace Kernel
61} // namespace Mantid
This class forms the base class of any item that wishes to be stored in the analysis data service.
Definition DataItem.h:39
Scoped write-lock for thread-safe access to DataItems.
Definition WriteLock.h:43
WriteLock(const WriteLock &)=delete
const DataItem & m_item
Reference to the data item we are locking.
Definition WriteLock.h:57
WriteLock & operator=(const WriteLock &)=delete
Helper class which provides the Collimation Length for SANS instruments.