Furrent
Public Types | Public Member Functions | List of all members
fur::mt::SharedQueue< T > Class Template Reference

#include <sharing_queue.hpp>

Public Types

using Error = typename policy::Queue< T >::Error
 
using Result = util::Result< T, Error >
 
using MutateFn = typename policy::Queue< T >::MutateFn
 

Public Member Functions

 SharedQueue ()
 
Result try_extract (const policy::IPolicy< T > &policy)
 
void insert (T &&work)
 
template<typename... Args>
void emplace (Args &&... args)
 
void mutate (MutateFn mutation)
 
void force_wakeup ()
 Wake up all waiting threads. More...
 
void wait_work () const
 Wait for a new item in the queue. More...
 
void wait_empty () const
 Wait for the queue to be empty. More...
 
void begin_skip_waiting ()
 

Detailed Description

template<typename T>
class fur::mt::SharedQueue< T >

Wrapper of policy::Queue to make it thread-safe and add concurrency related functionalities

Member Typedef Documentation

◆ Error

template<typename T >
using fur::mt::SharedQueue< T >::Error = typename policy::Queue<T>::Error

◆ MutateFn

template<typename T >
using fur::mt::SharedQueue< T >::MutateFn = typename policy::Queue<T>::MutateFn

◆ Result

template<typename T >
using fur::mt::SharedQueue< T >::Result = util::Result<T, Error>

Constructor & Destructor Documentation

◆ SharedQueue()

template<typename Work >
fur::mt::SharedQueue< Work >::SharedQueue

Member Function Documentation

◆ begin_skip_waiting()

template<typename T >
void fur::mt::SharedQueue< T >::begin_skip_waiting

Wake up all waiting threads and begins skipping work

◆ emplace()

template<typename T >
template<typename... Args>
void fur::mt::SharedQueue< T >::emplace ( Args &&...  args)

Construct an insert a new work in the internal list

Parameters
...argsargs used in the constructor of work

◆ force_wakeup()

template<typename T >
void fur::mt::SharedQueue< T >::force_wakeup

Wake up all waiting threads.

◆ insert()

template<typename T >
void fur::mt::SharedQueue< T >::insert ( T &&  work)

Insert new work in the internal list

Parameters
workWork to be inserted

◆ mutate()

template<typename T >
void fur::mt::SharedQueue< T >::mutate ( MutateFn  mutation)

Mutates the internal list of items in a locked way then signals all sleeping threads

◆ try_extract()

template<typename T >
auto fur::mt::SharedQueue< Work >::try_extract ( const policy::IPolicy< T > &  policy)

Tries to extract work from the queue

Parameters
policypolicy used to extract the element

◆ wait_empty()

template<typename T >
void fur::mt::SharedQueue< T >::wait_empty

Wait for the queue to be empty.

◆ wait_work()

template<typename T >
void fur::mt::SharedQueue< T >::wait_work

Wait for a new item in the queue.


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