OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
pointerContainer.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_UTILITIES_POINTER_CONTAINER_HPP
2 #define OPENPOSE_UTILITIES_POINTER_CONTAINER_HPP
3 
4 namespace op
5 {
6  template<typename TPointerContainer>
7  inline bool checkNoNullNorEmpty(const TPointerContainer& tPointerContainer)
8  {
9  return (tPointerContainer != nullptr && tPointerContainer->size() > 0);
10  }
11 
12  template<typename TDatumsSP>
14  {
15  public:
16  bool operator() (const TDatumsSP& a, const TDatumsSP& b)
17  {
18  if (!b || b->empty())
19  return true;
20  else if (!a || a->empty())
21  return false;
22  else
23  return *(*a)[0] > *(*b)[0];
24  }
25  };
26 
27  template<typename TDatumsSP>
29  {
30  public:
31  bool operator() (const TDatumsSP& a, const TDatumsSP& b)
32  {
33  if (!b || b->empty())
34  return false;
35  else if (!a || a->empty())
36  return true;
37  else
38  return *(*a)[0] < *(*b)[0];
39  }
40  };
41 }
42 
43 #endif // OPENPOSE_UTILITIES_POINTER_CONTAINER_HPP
bool operator()(const TDatumsSP &a, const TDatumsSP &b)
bool operator()(const TDatumsSP &a, const TDatumsSP &b)
bool checkNoNullNorEmpty(const TPointerContainer &tPointerContainer)