GEOSX
Public Member Functions | Public Attributes | List of all members
geos::FixedSizeDequeWithMutexes< T, INDEX_TYPE > Class Template Reference

Associate mutexes with the fixedSizeDeque. More...

#include <FixedSizeDequeWithMutexes.hpp>

Inheritance diagram for geos::FixedSizeDequeWithMutexes< T, INDEX_TYPE >:
Inheritance graph
[legend]

Public Member Functions

 FixedSizeDequeWithMutexes (int maxEntries, int valuesPerEntry, LvArray::MemorySpace space)
 
camp::resources::Event emplaceFront (arrayView1d< T > array)
 
camp::resources::Event popFront (arrayView1d< T > array)
 
void emplaceFrontFromBack (FixedSizeDequeWithMutexes< T, INDEX_TYPE > &q2)
 
void emplaceBackFromFront (FixedSizeDequeWithMutexes< T, INDEX_TYPE > &q2)
 
- Public Member Functions inherited from geos::FixedSizeDeque< T, INDEX_TYPE >
 FixedSizeDeque (IndexType maxEntries, IndexType valuesPerEntry, LvArray::MemorySpace space, camp::resources::Resource stream)
 
bool empty () const
 
bool full () const
 
size_t size () const
 
size_t capacity () const
 
ArraySlice1DLarge front () const
 
ArraySlice1DLarge next_front () const
 
ArraySlice1DLarge back () const
 
ArraySlice1DLarge next_back () const
 
void pop_front ()
 Removes first array of the queue.
 
void pop_back ()
 Removes last array of the queue.
 
void inc_front ()
 Add one array (uninitialized) at the front of the queue.
 
void inc_back ()
 Add one array (uninitialized) at the end of the queue.
 
template<typename INDEX_TYPE2 >
camp::resources::Event emplace_front (const LvArray::ArraySlice< T const, 1, 0, INDEX_TYPE2 > &src)
 
template<typename INDEX_TYPE2 >
camp::resources::Event emplace_back (const LvArray::ArraySlice< T const, 1, 0, INDEX_TYPE2 > &src)
 
camp::resources::Resource getStream ()
 

Public Attributes

std::mutex m_frontMutex
 Mutex to protect access to the front.
 
std::mutex m_backMutex
 Mutex to protect access to the back.
 
std::mutex m_popMutex
 Mutex to prevent two simulteaneous pop (can be an issue for last one)
 
std::mutex m_emplaceMutex
 Mutex to prevent two simulteaneous emplace (can be an issue for last one)
 
std::condition_variable_any m_notFullCond
 Condition used to notify when queue is not full.
 
std::condition_variable_any m_notEmptyCond
 Condition used to notify when queue is not empty.
 

Detailed Description

template<typename T, typename INDEX_TYPE>
class geos::FixedSizeDequeWithMutexes< T, INDEX_TYPE >

Associate mutexes with the fixedSizeDeque.

Definition at line 29 of file FixedSizeDequeWithMutexes.hpp.

Constructor & Destructor Documentation

◆ FixedSizeDequeWithMutexes()

template<typename T , typename INDEX_TYPE >
geos::FixedSizeDequeWithMutexes< T, INDEX_TYPE >::FixedSizeDequeWithMutexes ( int  maxEntries,
int  valuesPerEntry,
LvArray::MemorySpace  space 
)
inline

Create a fixed size double ended queue with associated mutexes and condition variables.

Parameters
maxEntriesMaximum number of array to store in the queue.
valuesPerEntryNumber of values in each array of the deque.
spaceSpace used to store que queue.

Definition at line 52 of file FixedSizeDequeWithMutexes.hpp.

Member Function Documentation

◆ emplaceBackFromFront()

template<typename T , typename INDEX_TYPE >
void geos::FixedSizeDequeWithMutexes< T, INDEX_TYPE >::emplaceBackFromFront ( FixedSizeDequeWithMutexes< T, INDEX_TYPE > &  q2)
inline

Emplace back from front of given queue

Parameters
q2The queue to copy data from.

Definition at line 149 of file FixedSizeDequeWithMutexes.hpp.

◆ emplaceFront()

template<typename T , typename INDEX_TYPE >
camp::resources::Event geos::FixedSizeDequeWithMutexes< T, INDEX_TYPE >::emplaceFront ( arrayView1d< T >  array)
inline

Emplace on front from array with locks.

Parameters
arrayThe array to emplace
Returns
Event to sync with the memcpy.

Definition at line 66 of file FixedSizeDequeWithMutexes.hpp.

◆ emplaceFrontFromBack()

template<typename T , typename INDEX_TYPE >
void geos::FixedSizeDequeWithMutexes< T, INDEX_TYPE >::emplaceFrontFromBack ( FixedSizeDequeWithMutexes< T, INDEX_TYPE > &  q2)
inline

Emplace front from back of given queue

Parameters
q2The queue to copy data from.

Definition at line 120 of file FixedSizeDequeWithMutexes.hpp.

◆ popFront()

template<typename T , typename INDEX_TYPE >
camp::resources::Event geos::FixedSizeDequeWithMutexes< T, INDEX_TYPE >::popFront ( arrayView1d< T >  array)
inline

Pop from front to array with locks

Parameters
arrayThe array to copy data into
Returns
Event to sync with the memcpy.

Definition at line 91 of file FixedSizeDequeWithMutexes.hpp.


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