OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
workerConsumer.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_THREAD_WORKER_CONSUMER_HPP
2 #define OPENPOSE_THREAD_WORKER_CONSUMER_HPP
3 
6 
7 namespace op
8 {
9  template<typename TDatums>
10  class WorkerConsumer : public Worker<TDatums>
11  {
12  public:
13  virtual ~WorkerConsumer();
14 
15  void work(TDatums& tDatums);
16 
17  protected:
18  virtual void workConsumer(const TDatums& tDatums) = 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 WorkerConsumer<TDatums>::work(TDatums& tDatums)
36  {
37  try
38  {
39  workConsumer(tDatums);
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_CONSUMER_HPP
virtual void workConsumer(const TDatums &tDatums)=0
void work(TDatums &tDatums)
COMPILE_TEMPLATE_DATUM(WPoseTriangulation)
OP_API void errorWorker(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")