Mantid
Loading...
Searching...
No Matches
Framework
Kernel
src
DataItem.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
//-----------------------------------------------------------------------------
8
// Includes
9
//-----------------------------------------------------------------------------
10
#include "
MantidKernel/DataItem.h
"
11
#include <Poco/RWLock.h>
12
13
namespace
Mantid::Kernel
{
14
17
DataItem::DataItem
() : m_lock(
std
::make_unique<
Poco
::RWLock>()) {}
18
22
DataItem::DataItem
(
const
DataItem
&
/*other*/
) : m_lock(
std
::make_unique<
Poco
::RWLock>()) {}
23
28
DataItem::~DataItem
() =
default
;
29
30
void
DataItem::readLock
() {
getLock
()->readLock(); }
31
void
DataItem::unlock
() {
getLock
()->unlock(); }
32
37
Poco::RWLock *
DataItem::getLock
()
const
{
return
m_lock
.get(); }
38
39
}
// namespace Mantid::Kernel
DataItem.h
Mantid::Kernel::DataItem
This class forms the base class of any item that wishes to be stored in the analysis data service.
Definition:
DataItem.h:39
Mantid::Kernel::DataItem::getLock
Poco::RWLock * getLock() const
Private method to access the RWLock object.
Definition:
DataItem.cpp:37
Mantid::Kernel::DataItem::readLock
void readLock()
Acquires a read lock.
Definition:
DataItem.cpp:30
Mantid::Kernel::DataItem::~DataItem
virtual ~DataItem()
Destructor.
Mantid::Kernel::DataItem::unlock
void unlock()
Definition:
DataItem.cpp:31
Mantid::Kernel::DataItem::DataItem
DataItem()
Default constructor.
Definition:
DataItem.cpp:17
Mantid::Kernel::DataItem::m_lock
std::unique_ptr< Poco::RWLock > m_lock
Multiple-reader/single-writer lock to restrict multithreaded access to the data item.
Definition:
DataItem.h:68
Mantid::Kernel
Definition:
AnnularRingAbsorption.h:15
Poco
Definition:
Algorithm.h:30
std
STL namespace.
Generated on Tue Jan 3 2023 11:57:50 for Mantid by
1.9.5