1 #ifndef MARLINMT_CONCURRENCY_QUEUEELEMENT_h 2 #define MARLINMT_CONCURRENCY_QUEUEELEMENT_h 1 10 namespace concurrency {
19 template <
typename IN,
typename OUT>
41 *
this = std::move(rhs) ;
49 _input = std::move(rhs._input) ;
56 std::shared_ptr<std::promise<OUT>>
promise()
const {
79 std::shared_ptr<std::promise<OUT>>
_promise {std::make_shared<std::promise<OUT>>()} ;
84 template <
typename OUT>
96 std::shared_ptr<std::promise<OUT>>
_promise {std::make_shared<std::promise<OUT>>()} ;
99 template <
typename IN>
109 _promise = std::move(rhs._promise) ;
110 _input = std::move(rhs._input) ;
117 std::shared_ptr<std::promise<void>>
_promise {std::make_shared<std::promise<void>>()} ;
133 std::shared_ptr<std::promise<void>>
_promise {std::make_shared<std::promise<void>>()} ;
void setValue(OUT &&output)
Set the value to be retrieved in the future variable.
std::shared_ptr< std::promise< void > > promise() const
QueueElement(IN &&input)
Constructor with input data.
std::shared_ptr< std::promise< void > > promise() const
QueueElement & operator=(QueueElement< IN, void > &&rhs)
std::shared_ptr< std::promise< OUT > > _promise
< The promise for getting the output data
void setValue(OUT &&output)
QueueElement & operator=(QueueElement< void, void > &&rhs)
QueueElement(QueueElement< IN, void > &&rhs)
std::shared_ptr< std::promise< OUT > > promise() const
QueueElement & operator=(QueueElement< IN, OUT > &&rhs)
Move assignement operator.
QueueElement(QueueElement< void, OUT > &&rhs)
QueueElement & operator=(const QueueElement< IN, OUT > &)=delete
std::shared_ptr< std::promise< OUT > > promise() const
Get the output promise.
QueueElement(QueueElement< IN, OUT > &&rhs)
Move constructor.
IN takeInput()
Take the input data.
QueueElement class A template queue element used in the thread pool.
QueueElement & operator=(QueueElement< void, OUT > &&rhs)
QueueElement(QueueElement< void, void > &&rhs)