Mantid
|
This class forms the base class of any item that wishes to be stored in the analysis data service. More...
#include <DataItem.h>
Public Member Functions | |
DataItem () | |
Default constructor. More... | |
DataItem (const DataItem &other) | |
Copy constructor Always makes a unique lock. More... | |
virtual | ~DataItem () |
Destructor. More... | |
Interface | |
std::unique_ptr< Poco::RWLock > | m_lock |
Multiple-reader/single-writer lock to restrict multithreaded access to the data item. More... | |
class | ReadLock |
Allow the ReadLock class direct access to the m_lock object. More... | |
class | WriteLock |
Allow the WriteLock class direct access to the m_lock object. More... | |
class | Mantid::API::Algorithm |
Allow the Algorithm class but NOT its derived classes to get the lock object. More... | |
virtual const std::string | id () const =0 |
A string ID for the class. More... | |
virtual const std::string & | getName () const =0 |
The name of the object. More... | |
virtual bool | threadSafe () const =0 |
Can this object be accessed from multiple threads safely. More... | |
virtual const std::string | toString () const =0 |
Serializes the object to a string. More... | |
void | readLock () |
Acquires a read lock. More... | |
void | unlock () |
Poco::RWLock * | getLock () const |
Private method to access the RWLock object. More... | |
This class forms the base class of any item that wishes to be stored in the analysis data service.
Definition at line 39 of file DataItem.h.
Mantid::Kernel::DataItem::DataItem | ( | ) |
Default constructor.
Definition at line 17 of file DataItem.cpp.
Mantid::Kernel::DataItem::DataItem | ( | const DataItem & | other | ) |
Copy constructor Always makes a unique lock.
Definition at line 22 of file DataItem.cpp.
|
virtualdefault |
Destructor.
Required in cpp do avoid linker errors when other projects try to inherit from DataItem
|
protected |
Private method to access the RWLock object.
Definition at line 37 of file DataItem.cpp.
References m_lock.
Referenced by readLock(), and unlock().
|
pure virtual |
The name of the object.
Implemented in Mantid::API::Workspace, and MDHistoWorkspaceTester.
Referenced by export_DataItem().
|
pure virtual |
A string ID for the class.
Implemented in Mantid::API::IEventWorkspace, Mantid::API::ITableWorkspace, Mantid::API::WorkspaceGroup, Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::GroupingWorkspace, Mantid::DataObjects::LeanElasticPeaksWorkspace, Mantid::DataObjects::MaskWorkspace, Mantid::DataObjects::MDEventWorkspace, Mantid::DataObjects::MDHistoWorkspace, Mantid::DataObjects::OffsetsWorkspace, Mantid::DataObjects::PeaksWorkspace, Mantid::DataObjects::RebinnedOutput, Mantid::DataObjects::SpecialWorkspace2D, Mantid::DataObjects::TableWorkspace, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, FakeWorkspace, AxeslessWorkspaceTester, WorkspaceTester, TableWorkspaceTester, and MDHistoWorkspaceTester.
Referenced by export_DataItem(), Mantid::API::MatrixWorkspace::getDimensionIdFromAxis(), Mantid::API::MatrixWorkspace::getDimensionWithId(), MantidQt::MantidWidgets::WorkspaceIsNotOfType::operator()(), Mantid::API::IMDWorkspace::toString(), and Mantid::API::MatrixWorkspace::toString().
void Mantid::Kernel::DataItem::readLock | ( | ) |
Acquires a read lock.
If another thread currently holds a write lock, waits until the write lock is released.
Definition at line 30 of file DataItem.cpp.
References getLock().
|
pure virtual |
Can this object be accessed from multiple threads safely.
Implemented in Mantid::API::IMDEventWorkspace, Mantid::API::Workspace, Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::LeanElasticPeaksWorkspace, Mantid::DataObjects::PeaksWorkspace, and MDHistoWorkspaceTester.
Referenced by export_DataItem().
|
pure virtual |
Serializes the object to a string.
Implemented in Mantid::API::MatrixWorkspace, Mantid::API::IEventWorkspace, Mantid::API::IMDEventWorkspace, Mantid::API::IMDHistoWorkspace, Mantid::API::IMDWorkspace, Mantid::API::IPeaksWorkspace, Mantid::API::ITableWorkspace, Mantid::API::MatrixWorkspace, Mantid::API::MatrixWorkspace, Mantid::API::WorkspaceGroup, Mantid::DataObjects::MaskWorkspace, Mantid::DataObjects::SpecialWorkspace2D, FakeWorkspace, and MDHistoWorkspaceTester.
Referenced by export_DataItem().
void Mantid::Kernel::DataItem::unlock | ( | ) |
Definition at line 31 of file DataItem.cpp.
References getLock().
|
friend |
Allow the Algorithm class but NOT its derived classes to get the lock object.
Definition at line 76 of file DataItem.h.
|
friend |
Allow the ReadLock class direct access to the m_lock object.
Definition at line 71 of file DataItem.h.
|
friend |
Allow the WriteLock class direct access to the m_lock object.
Definition at line 73 of file DataItem.h.
|
private |
Multiple-reader/single-writer lock to restrict multithreaded access to the data item.
Definition at line 68 of file DataItem.h.
Referenced by getLock(), Mantid::Kernel::ReadLock::ReadLock(), Mantid::Kernel::WriteLock::WriteLock(), Mantid::Kernel::ReadLock::~ReadLock(), and Mantid::Kernel::WriteLock::~WriteLock().