All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
standard.hpp
Go to the documentation of this file.
#ifndef OPENPOSE_UTILITIES_STANDARD_HPP
#define OPENPOSE_UTILITIES_STANDARD_HPP
#include <openpose/core/common.hpp>
namespace op
{
template <typename T>
bool vectorsAreEqual(const std::vector<T>& vectorA, const std::vector<T>& vectorB)
{
try
{
if (vectorA.size() != vectorB.size())
return false;
else
{
for (auto i = 0u ; i < vectorA.size() ; i++)
if (vectorA[i] != vectorB[i])
return false;
return true;
}
}
catch (const std::exception& e)
{
error(e.what(), __LINE__, __FUNCTION__, __FILE__);
return false;
}
}
template <typename T>
std::vector<T> mergeVectors(const std::vector<T>& vectorA, const std::vector<T>& vectorB)
{
try
{
auto vectorToReturn(vectorA);
for (auto& tElement : vectorB)
vectorToReturn.emplace_back(tElement);
return vectorToReturn;
}
catch (const std::exception& e)
{
error(e.what(), __LINE__, __FUNCTION__, __FILE__);
return std::vector<T>{};
}
}
}
#endif // OPENPOSE_UTILITIES_STANDARD_HPP
common.hpp
op::error
OP_API void error(const std::string &message, const int line=-1, const std::string &function="", const std::string &file="")
op::mergeVectors
std::vector< T > mergeVectors(const std::vector< T > &vectorA, const std::vector< T > &vectorB)
Definition: standard.hpp:40
op::vectorsAreEqual
bool vectorsAreEqual(const std::vector< T > &vectorA, const std::vector< T > &vectorB)
Definition: standard.hpp:9