OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
workerProducer.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_THREAD_WORKER_PRODUCER_HPP
2 #define OPENPOSE_THREAD_WORKER_PRODUCER_HPP
3 
6 
7 namespace op
8 {
9  template<typename TDatums>
10  class WorkerProducer : public Worker<TDatums>
11  {
12  public:
13  virtual ~WorkerProducer();
14 
15  void work(TDatums& tDatums);
16 
17  protected:
18  virtual TDatums workProducer() = 0;
19  };
20 }
21 
22 
23 
24 
25 
26 // Implementation
27 namespace op
28 {
29  template<typename TDatums>
31  {
32  }
33 
34  template<typename TDatums>
35  void WorkerProducer<TDatums>::work(TDatums& tDatums)
36  {
37  try
38  {
39  tDatums = std::move(workProducer());
40  }
41  catch (const std::exception& e)
42  {
43  this->stop();
44  errorWorker(e.what(), __LINE__, __FUNCTION__, __FILE__);
45  }
46  }
47 
49 }
50 
51 #endif // OPENPOSE_THREAD_WORKER_PRODUCER_HPP
void work(TDatums &tDatums)
virtual TDatums workProducer()=0
COMPILE_TEMPLATE_DATUM(WPoseTriangulation)
OP_API void errorWorker(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")