Mantid
|
This is a container for the MRU (most-recently-used) list of generated histograms. More...
#include <EventWorkspaceMRU.h>
Public Types | |
using | EType = Kernel::cow_ptr< HistogramData::HistogramE > |
using | EWithMarker = TypeWithMarker< EType > |
using | mru_listE = Kernel::MRUList< EWithMarker > |
using | mru_listY = Kernel::MRUList< YWithMarker > |
using | YType = Kernel::cow_ptr< HistogramData::HistogramY > |
using | YWithMarker = TypeWithMarker< YType > |
Public Member Functions | |
void | clear () |
Clear all the data in the MRU buffers. More... | |
void | deleteIndex (const EventList *index) |
Delete any entries in the MRU at the given index. More... | |
void | ensureEnoughBuffersE (size_t thread_num) const |
This function makes sure that there are enough data buffers (MRU's) for E for the number of threads requested. More... | |
void | ensureEnoughBuffersY (size_t thread_num) const |
This function makes sure that there are enough data buffers (MRU's) for Y for the number of threads requested. More... | |
EType | findE (size_t thread_num, const EventList *index) |
Find a Y histogram in the MRU. More... | |
YType | findY (size_t thread_num, const EventList *index) |
Find a Y histogram in the MRU. More... | |
void | insertE (size_t thread_num, EType data, const EventList *index) |
Insert a new histogram into the MRU. More... | |
void | insertY (size_t thread_num, YType data, const EventList *index) |
Insert a new histogram into the MRU. More... | |
size_t | MRUSize () const |
Return how many entries in the Y MRU list are used. More... | |
~EventWorkspaceMRU () | |
Protected Attributes | |
std::vector< std::unique_ptr< mru_listE > > | m_bufferedDataE |
The most-recently-used list of dataE histograms. More... | |
std::vector< std::unique_ptr< mru_listY > > | m_bufferedDataY |
The most-recently-used list of dataY histograms. More... | |
Poco::RWLock | m_changeMruListsMutexE |
Mutex when adding entries in the MRU list. More... | |
Poco::RWLock | m_changeMruListsMutexY |
This is a container for the MRU (most-recently-used) list of generated histograms.
Definition at line 62 of file EventWorkspaceMRU.h.
using Mantid::DataObjects::EventWorkspaceMRU::EType = Kernel::cow_ptr<HistogramData::HistogramE> |
Definition at line 65 of file EventWorkspaceMRU.h.
Definition at line 67 of file EventWorkspaceMRU.h.
Definition at line 70 of file EventWorkspaceMRU.h.
Definition at line 69 of file EventWorkspaceMRU.h.
using Mantid::DataObjects::EventWorkspaceMRU::YType = Kernel::cow_ptr<HistogramData::HistogramY> |
Definition at line 64 of file EventWorkspaceMRU.h.
Definition at line 66 of file EventWorkspaceMRU.h.
Mantid::DataObjects::EventWorkspaceMRU::~EventWorkspaceMRU | ( | ) |
Definition at line 14 of file EventWorkspaceMRU.cpp.
References m_bufferedDataE, m_bufferedDataY, m_changeMruListsMutexE, and m_changeMruListsMutexY.
void Mantid::DataObjects::EventWorkspaceMRU::clear | ( | ) |
Clear all the data in the MRU buffers.
Definition at line 63 of file EventWorkspaceMRU.cpp.
References m_bufferedDataE, m_bufferedDataY, m_changeMruListsMutexE, and m_changeMruListsMutexY.
void Mantid::DataObjects::EventWorkspaceMRU::deleteIndex | ( | const EventList * | index | ) |
Delete any entries in the MRU at the given index.
index | :: index to delete. |
Definition at line 143 of file EventWorkspaceMRU.cpp.
References index, m_bufferedDataE, m_bufferedDataY, m_changeMruListsMutexE, and m_changeMruListsMutexY.
Referenced by Mantid::DataObjects::EventList::clear(), Mantid::DataObjects::EventList::dataX(), Mantid::DataObjects::EventList::mutableHistogramRef(), and Mantid::DataObjects::EventList::setX().
void Mantid::DataObjects::EventWorkspaceMRU::ensureEnoughBuffersE | ( | size_t | thread_num | ) | const |
This function makes sure that there are enough data buffers (MRU's) for E for the number of threads requested.
thread_num | :: thread number that wants a MRU buffer |
Definition at line 37 of file EventWorkspaceMRU.cpp.
References m_bufferedDataE, and m_changeMruListsMutexE.
Referenced by Mantid::DataObjects::EventList::sharedE(), and Mantid::DataObjects::EventList::sharedY().
void Mantid::DataObjects::EventWorkspaceMRU::ensureEnoughBuffersY | ( | size_t | thread_num | ) | const |
This function makes sure that there are enough data buffers (MRU's) for Y for the number of threads requested.
thread_num | :: thread number that wants a MRU buffer |
Definition at line 51 of file EventWorkspaceMRU.cpp.
References m_bufferedDataY, and m_changeMruListsMutexY.
Referenced by Mantid::DataObjects::EventList::sharedY().
Kernel::cow_ptr< HistogramData::HistogramE > Mantid::DataObjects::EventWorkspaceMRU::findE | ( | size_t | thread_num, |
const EventList * | index | ||
) |
Find a Y histogram in the MRU.
thread_num | :: number of the thread in which this is run |
index | :: index of the data to return |
Definition at line 103 of file EventWorkspaceMRU.cpp.
References index, m_bufferedDataE, and m_changeMruListsMutexE.
Referenced by Mantid::DataObjects::EventList::sharedE().
Kernel::cow_ptr< HistogramData::HistogramY > Mantid::DataObjects::EventWorkspaceMRU::findY | ( | size_t | thread_num, |
const EventList * | index | ||
) |
Find a Y histogram in the MRU.
thread_num | :: number of the thread in which this is run |
index | :: index of the data to return |
Definition at line 89 of file EventWorkspaceMRU.cpp.
References index, m_bufferedDataY, and m_changeMruListsMutexY.
Referenced by Mantid::DataObjects::EventList::sharedY().
void Mantid::DataObjects::EventWorkspaceMRU::insertE | ( | size_t | thread_num, |
EType | data, | ||
const EventList * | index | ||
) |
Insert a new histogram into the MRU.
thread_num | :: thread being accessed |
data | :: the new data |
index | :: index of the data to insert |
Definition at line 131 of file EventWorkspaceMRU.cpp.
References index, m_bufferedDataE, and m_changeMruListsMutexE.
Referenced by Mantid::DataObjects::EventList::sharedE(), and Mantid::DataObjects::EventList::sharedY().
void Mantid::DataObjects::EventWorkspaceMRU::insertY | ( | size_t | thread_num, |
YType | data, | ||
const EventList * | index | ||
) |
Insert a new histogram into the MRU.
thread_num | :: thread being accessed |
data | :: the new data |
index | :: index of the data to insert |
Definition at line 117 of file EventWorkspaceMRU.cpp.
References index, m_bufferedDataY, and m_changeMruListsMutexY.
Referenced by Mantid::DataObjects::EventList::sharedY().
size_t Mantid::DataObjects::EventWorkspaceMRU::MRUSize | ( | ) | const |
Return how many entries in the Y MRU list are used.
Only used in tests. It only returns the 0-th MRU list size.
Definition at line 160 of file EventWorkspaceMRU.cpp.
References m_bufferedDataY.
|
mutableprotected |
The most-recently-used list of dataE histograms.
Definition at line 96 of file EventWorkspaceMRU.h.
Referenced by clear(), deleteIndex(), ensureEnoughBuffersE(), findE(), insertE(), and ~EventWorkspaceMRU().
|
mutableprotected |
The most-recently-used list of dataY histograms.
Definition at line 93 of file EventWorkspaceMRU.h.
Referenced by clear(), deleteIndex(), ensureEnoughBuffersY(), findY(), insertY(), MRUSize(), and ~EventWorkspaceMRU().
|
mutableprotected |
Mutex when adding entries in the MRU list.
Definition at line 99 of file EventWorkspaceMRU.h.
Referenced by clear(), deleteIndex(), ensureEnoughBuffersE(), findE(), insertE(), and ~EventWorkspaceMRU().
|
mutableprotected |
Definition at line 100 of file EventWorkspaceMRU.h.
Referenced by clear(), deleteIndex(), ensureEnoughBuffersY(), findY(), insertY(), and ~EventWorkspaceMRU().