OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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>
13 class PointerContainerGreater
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>
28 class PointerContainerLess
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
op::PointerContainerGreater
Definition: pointerContainer.hpp:13
op::checkNoNullNorEmpty
bool checkNoNullNorEmpty(const TPointerContainer &tPointerContainer)
Definition: pointerContainer.hpp:7
op::PointerContainerGreater::operator()
bool operator()(TDatums &a, TDatums &b)
Definition: pointerContainer.hpp:16
op::PointerContainerLess::operator()
bool operator()(TDatums &a, TDatums &b)
Definition: pointerContainer.hpp:31
op::PointerContainerLess
Definition: pointerContainer.hpp:28