Loading...
Searching...
No Matches
libthreadar::ratelier_gather< T > Class Template Reference

the class ratelier_gather has a fixed length range of slots of arbitrary defined object type More...

`#include <ratelier_gather.hpp>`

## Public Member Functions

| ratelier_gather (unsigned int size, signed int flag=0)
| ratelier_gather (const ratelier_gather &ref)=delete
| ratelier_gather (ratelier_gather &&ref)=default
ratelier_gather & | operator= (const ratelier_gather &ref)=delete
ratelier_gather & | operator= (ratelier_gather &&ref) noexcept=default
void | worker_push_one (unsigned int slot, std::unique_ptr< T > &one, signed int flag=0)
| provides to a worker thread a mean to given data with its associated index to a gathering thread
void | gather (std::deque< std::unique_ptr< T > > &ones, std::deque< signed int > &flag)
| obtain the lowest continuous filled slots of the ratelier_gather and free them
void | reset ()
| reset the object in its prestine state

## Detailed Description

template<class T>
class libthreadar::ratelier_gather< T >

the class ratelier_gather has a fixed length range of slots of arbitrary defined object type

the number of slot should be greater than the number of workers that fill the ratelier with data. Workers put objects each at a given slot and a non-worker thread (or gathering thread) get those objects in order, which releases the corresponding slots of the ratelier_gather object

Definition at line 97 of file ratelier_gather.hpp.

## Constructor & Destructor Documentation

## ratelier_gather()

template<class T >

libthreadar::ratelier_gather< T >::ratelier_gather | ( | unsigned int | size,
|  | signed int | flag = `0`
| ) |  |

Definition at line 150 of file ratelier_gather.hpp.

## Member Function Documentation

## gather()

template<class T >

void libthreadar::ratelier_gather< T >::gather | ( | std::deque< std::unique_ptr< T > > & | ones,
|  | std::deque< signed int > & | flag
| ) |  |

obtain the lowest continuous filled slots of the ratelier_gather and free them

Parameters

  [out] | ones | is a list of continuously indexed objects which immediately follows the list provided by a previous call to gather().
  [out] | flag | is the purpose free signal give by the worker and associated to each data

Definition at line 210 of file ratelier_gather.hpp.

References THREADAR_BUG.

## reset()

template<class T >

void libthreadar::ratelier_gather< T >::reset | ( |  | ) |

reset the object in its prestine state

Definition at line 281 of file ratelier_gather.hpp.

## worker_push_one()

template<class T >

void libthreadar::ratelier_gather< T >::worker_push_one | ( | unsigned int | slot,
|  | std::unique_ptr< T > & | one,
|  | signed int | flag = `0`
| ) |  |

provides to a worker thread a mean to given data with its associated index to a gathering thread

Parameters

  [in] | slot | is the slot number associated to the provided object "one"
  [in] | one | is the object to push to the gathering thread
  [in] | flag | is a purpose free signal to send to the gathering thread as associated to this object.

Note
  if the slot is already full an exception is thrown
  if the ratelier_gather is full the caller will be suspended until the non-worker thread calls gather() to make some room

Definition at line 160 of file ratelier_gather.hpp.

References THREADAR_BUG.

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

- ratelier_gather.hpp