Libthreadar 1.4.0
|
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 More... | |
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 More... | |
void | reset () |
reset the object in its prestine state More... | |
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 at a given slot and a non-worker thread (or gathering thread) get those objects in order, this releases the corresponding slots of the ratelier_gather
Definition at line 97 of file ratelier_gather.hpp.
libthreadar::ratelier_gather< T >::ratelier_gather | ( | unsigned int | size, |
signed int | flag = 0 |
||
) |
Definition at line 152 of file ratelier_gather.hpp.
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
[out] | ones | is a list of continuously indexed objects which immediately follows the list provided by a previous call to gather() and will be immediately followed by the list returned by a next call to gather(). |
[out] | flag | is the purpose free signal give by the worker and associated to each data |
Definition at line 212 of file ratelier_gather.hpp.
References THREADAR_BUG.
void libthreadar::ratelier_gather< T >::reset |
reset the object in its prestine state
Definition at line 283 of file ratelier_gather.hpp.
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
[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 and associated to this object. the value it had before this call with the value given in argument to the call |
Definition at line 162 of file ratelier_gather.hpp.
References THREADAR_BUG.