Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
Mantid::DataObjects::EventWorkspaceMRU Class Reference

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
 

Detailed Description

This is a container for the MRU (most-recently-used) list of generated histograms.

Definition at line 62 of file EventWorkspaceMRU.h.

Member Typedef Documentation

◆ EType

Definition at line 65 of file EventWorkspaceMRU.h.

◆ EWithMarker

Definition at line 67 of file EventWorkspaceMRU.h.

◆ mru_listE

Definition at line 70 of file EventWorkspaceMRU.h.

◆ mru_listY

Definition at line 69 of file EventWorkspaceMRU.h.

◆ YType

Definition at line 64 of file EventWorkspaceMRU.h.

◆ YWithMarker

Definition at line 66 of file EventWorkspaceMRU.h.

Constructor & Destructor Documentation

◆ ~EventWorkspaceMRU()

Mantid::DataObjects::EventWorkspaceMRU::~EventWorkspaceMRU ( )

Member Function Documentation

◆ clear()

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.

◆ deleteIndex()

void Mantid::DataObjects::EventWorkspaceMRU::deleteIndex ( const EventList index)

◆ ensureEnoughBuffersE()

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.

Parameters
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().

◆ ensureEnoughBuffersY()

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.

Parameters
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().

◆ findE()

Kernel::cow_ptr< HistogramData::HistogramE > Mantid::DataObjects::EventWorkspaceMRU::findE ( size_t  thread_num,
const EventList index 
)

Find a Y histogram in the MRU.

Parameters
thread_num:: number of the thread in which this is run
index:: index of the data to return
Returns
pointer to the TypeWithMarker that has the data; NULL if not found.

Definition at line 103 of file EventWorkspaceMRU.cpp.

References index, m_bufferedDataE, and m_changeMruListsMutexE.

Referenced by Mantid::DataObjects::EventList::sharedE().

◆ findY()

Kernel::cow_ptr< HistogramData::HistogramY > Mantid::DataObjects::EventWorkspaceMRU::findY ( size_t  thread_num,
const EventList index 
)

Find a Y histogram in the MRU.

Parameters
thread_num:: number of the thread in which this is run
index:: index of the data to return
Returns
pointer to the TypeWithMarker that has the data; NULL if not found.

Definition at line 89 of file EventWorkspaceMRU.cpp.

References index, m_bufferedDataY, and m_changeMruListsMutexY.

Referenced by Mantid::DataObjects::EventList::sharedY().

◆ insertE()

void Mantid::DataObjects::EventWorkspaceMRU::insertE ( size_t  thread_num,
EType  data,
const EventList index 
)

Insert a new histogram into the MRU.

Parameters
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().

◆ insertY()

void Mantid::DataObjects::EventWorkspaceMRU::insertY ( size_t  thread_num,
YType  data,
const EventList index 
)

Insert a new histogram into the MRU.

Parameters
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().

◆ MRUSize()

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.

Returns
:: number of entries in the MRU list.

Definition at line 160 of file EventWorkspaceMRU.cpp.

References m_bufferedDataY.

Member Data Documentation

◆ m_bufferedDataE

std::vector<std::unique_ptr<mru_listE> > Mantid::DataObjects::EventWorkspaceMRU::m_bufferedDataE
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().

◆ m_bufferedDataY

std::vector<std::unique_ptr<mru_listY> > Mantid::DataObjects::EventWorkspaceMRU::m_bufferedDataY
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().

◆ m_changeMruListsMutexE

Poco::RWLock Mantid::DataObjects::EventWorkspaceMRU::m_changeMruListsMutexE
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().

◆ m_changeMruListsMutexY

Poco::RWLock Mantid::DataObjects::EventWorkspaceMRU::m_changeMruListsMutexY
mutableprotected

The documentation for this class was generated from the following files: