OpenPose  1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 TDatums>
14  {
15  public:
16  bool operator() (TDatums& a, TDatums& 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 TDatums>
29  {
30  public:
31  bool operator() (TDatums& a, TDatums& 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
Definition: pointerContainer.hpp:13
bool checkNoNullNorEmpty(const TPointerContainer &tPointerContainer)
Definition: pointerContainer.hpp:7
bool operator()(TDatums &a, TDatums &b)
Definition: pointerContainer.hpp:16
bool operator()(TDatums &a, TDatums &b)
Definition: pointerContainer.hpp:31
Definition: pointerContainer.hpp:28