1 #ifndef OPENPOSE_THREAD_THREAD_QUEUE_OUT_HPP
2 #define OPENPOSE_THREAD_THREAD_QUEUE_OUT_HPP
11 template<
typename TDatums,
typename TWorker = std::shared_ptr<Worker<TDatums>>,
typename TQueue = Queue<TDatums>>
15 SubThreadQueueOut(
const std::vector<TWorker>& tWorkers,
const std::shared_ptr<TQueue>& tQueueOut);
22 std::shared_ptr<TQueue> spTQueueOut;
35 template<
typename TDatums,
typename TWorker,
typename TQueue>
37 const std::shared_ptr<TQueue>& tQueueOut) :
39 spTQueueOut{tQueueOut}
41 spTQueueOut->addPusher();
44 template<
typename TDatums,
typename TWorker,
typename TQueue>
49 template<
typename TDatums,
typename TWorker,
typename TQueue>
55 if (!spTQueueOut->isRunning())
61 if (!spTQueueOut->isFull())
65 const auto workersAreRunning = this->workTWorkers(tDatums,
true);
67 if (workersAreRunning)
69 if (tDatums !=
nullptr)
70 spTQueueOut->waitAndEmplace(tDatums);
74 spTQueueOut->stopPusher();
75 return workersAreRunning;
79 std::this_thread::sleep_for(std::chrono::microseconds{100});
84 catch (
const std::exception& e)
86 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
SubThreadQueueOut(const std::vector< TWorker > &tWorkers, const std::shared_ptr< TQueue > &tQueueOut)
virtual ~SubThreadQueueOut()
COMPILE_TEMPLATE_DATUM(WPoseTriangulation)
OP_API void error(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")