types.cpp
Go to the documentation of this file.
1 
29 #include <boost/functional/hash.hpp>
31 
32 #include <tesseract_common/types.h>
33 
34 namespace tesseract_common
35 {
36 std::size_t PairHash::operator()(const LinkNamesPair& pair) const
37 {
38  std::size_t seed{ 0 };
39  boost::hash_combine(seed, pair.first);
40  boost::hash_combine(seed, pair.second);
41  return seed;
42 }
43 
44 LinkNamesPair makeOrderedLinkPair(const std::string& link_name1, const std::string& link_name2)
45 {
46  return (link_name1 <= link_name2) ? std::make_pair(link_name1, link_name2) : std::make_pair(link_name2, link_name1);
47 }
48 
49 void makeOrderedLinkPair(LinkNamesPair& pair, const std::string& link_name1, const std::string& link_name2)
50 {
51  if (link_name1 <= link_name2)
52  {
53  pair.first = link_name1;
54  pair.second = link_name2;
55  }
56  else
57  {
58  pair.first = link_name2;
59  pair.second = link_name1;
60  }
61 }
62 } // namespace tesseract_common
tesseract_common
Definition: allowed_collision_matrix.h:19
types.h
Common Tesseract Types.
macros.h
Common Tesseract Macros.
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
tesseract_common::LinkNamesPair
std::pair< std::string, std::string > LinkNamesPair
Definition: types.h:37
tesseract_common::PairHash::operator()
std::size_t operator()(const LinkNamesPair &pair) const
Definition: types.cpp:36
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
Definition: macros.h:72
tesseract_common::makeOrderedLinkPair
LinkNamesPair makeOrderedLinkPair(const std::string &link_name1, const std::string &link_name2)
Create a pair of strings, where the pair.first is always <= pair.second.
Definition: types.cpp:44


tesseract_common
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:40