All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pointerContainer.hpp
Go to the documentation of this file.
#ifndef OPENPOSE_UTILITIES_POINTER_CONTAINER_HPP
#define OPENPOSE_UTILITIES_POINTER_CONTAINER_HPP
namespace op
{
template<typename TPointerContainer>
inline bool checkNoNullNorEmpty(const TPointerContainer& tPointerContainer)
{
return (tPointerContainer != nullptr && tPointerContainer->size() > 0);
}
template<typename TDatums>
class PointerContainerGreater
{
public:
bool operator() (TDatums& a, TDatums& b)
{
if (!b || b->empty())
return true;
else if (!a || a->empty())
return false;
else
return (*a)[0] > (*b)[0];
}
};
template<typename TDatums>
class PointerContainerLess
{
public:
bool operator() (TDatums& a, TDatums& b)
{
if (!b || b->empty())
return false;
else if (!a || a->empty())
return true;
else
return (*a)[0] < (*b)[0];
}
};
}
#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