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);
20 std::shared_ptr<TQueue> spTQueueIn;
33 template<
typename TDatums,
typename TWorker,
typename TQueue>
35 const std::shared_ptr<TQueue>& tQueueIn) :
42 template<
typename TDatums,
typename TWorker,
typename TQueue>
49 std::this_thread::sleep_for(std::chrono::microseconds{100});
51 bool queueIsRunning =
spTQueueIn->tryPop(tDatums);
56 const auto workersAreRunning = this->workTWorkers(tDatums, queueIsRunning);
58 if (!workersAreRunning)
60 return workersAreRunning;
62 catch (
const std::exception& e)
64 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
73 #endif // OPENPOSE_THREAD_THREAD_QUEUE_IN_HPP
Definition: subThread.hpp:10
SubThreadQueueIn(const std::vector< TWorker > &tWorkers, const std::shared_ptr< TQueue > &tQueueIn)
Definition: subThreadQueueIn.hpp:34
OP_API void error(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")
spTQueueIn
Definition: subThreadQueueIn.hpp:37
COMPILE_TEMPLATE_DATUM(WPoseTriangulation)
Definition: subThreadQueueIn.hpp:12