1 #ifndef OPENPOSE_THREAD_THREAD_QUEUE_IN_OUT_HPP
2 #define OPENPOSE_THREAD_THREAD_QUEUE_IN_OUT_HPP
11 template<
typename TDatums,
typename TWorker = std::shared_ptr<Worker<TDatums>>,
typename TQueue = Queue<TDatums>>
15 SubThreadQueueInOut(
const std::vector<TWorker>& tWorkers,
const std::shared_ptr<TQueue>& tQueueIn,
const std::shared_ptr<TQueue>& tQueueOut);
20 std::shared_ptr<TQueue> spTQueueIn;
21 std::shared_ptr<TQueue> spTQueueOut;
34 template<
typename TDatums,
typename TWorker,
typename TQueue>
36 const std::shared_ptr<TQueue>& tQueueOut) :
45 template<
typename TDatums,
typename TWorker,
typename TQueue>
61 bool workersAreRunning =
spTQueueIn->tryPop(tDatums);
63 if (!workersAreRunning)
66 workersAreRunning = this->workTWorkers(tDatums, workersAreRunning);
68 if (workersAreRunning)
70 if (tDatums !=
nullptr)
79 return workersAreRunning;
82 catch (
const std::exception& e)
84 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
94 #endif // OPENPOSE_THREAD_THREAD_QUEUE_IN_OUT_HPP
Definition: subThread.hpp:10
OP_API void error(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")
SubThreadQueueInOut(const std::vector< TWorker > &tWorkers, const std::shared_ptr< TQueue > &tQueueIn, const std::shared_ptr< TQueue > &tQueueOut)
Definition: subThreadQueueInOut.hpp:35
spTQueueIn
Definition: subThreadQueueIn.hpp:36
spTQueueOut
Definition: subThreadQueueInOut.hpp:39
Definition: subThreadQueueInOut.hpp:12
COMPILE_TEMPLATE_DATUM(WPoseTriangulation)