1 #ifndef OPENPOSE_THREAD_THREAD_QUEUE_IN_HPP
2 #define OPENPOSE_THREAD_THREAD_QUEUE_IN_HPP
11 template<
typename TDatums,
typename TWorker = std::shared_ptr<Worker<TDatums>>,
typename TQueue = Queue<TDatums>>
15 SubThreadQueueIn(
const std::vector<TWorker>& tWorkers,
const std::shared_ptr<TQueue>& tQueueIn);
22 std::shared_ptr<TQueue> spTQueueIn;
35 template<
typename TDatums,
typename TWorker,
typename TQueue>
37 const std::shared_ptr<TQueue>& tQueueIn) :
44 template<
typename TDatums,
typename TWorker,
typename TQueue>
49 template<
typename TDatums,
typename TWorker,
typename TQueue>
55 if (spTQueueIn->empty())
56 std::this_thread::sleep_for(std::chrono::microseconds{100});
58 bool queueIsRunning = spTQueueIn->tryPop(tDatums);
61 queueIsRunning = spTQueueIn->isRunning();
63 const auto workersAreRunning = this->workTWorkers(tDatums, queueIsRunning);
65 if (!workersAreRunning)
67 return workersAreRunning;
69 catch (
const std::exception& e)
71 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
SubThreadQueueIn(const std::vector< TWorker > &tWorkers, const std::shared_ptr< TQueue > &tQueueIn)
virtual ~SubThreadQueueIn()
COMPILE_TEMPLATE_DATUM(WPoseTriangulation)
OP_API void error(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")