Tesseract 0.28.4
Loading...
Searching...
No Matches
types.h File Reference

Common Tesseract Types. More...

#include <tesseract/common/macros.h>
#include <string>
#include <utility>

Classes

struct  std::hash< tesseract::common::LinkNamesPair >
 

Typedefs

using tesseract::common::LinkNamesPair = std::pair< std::string, std::string >
 

Functions

LinkNamesPair tesseract::common::makeOrderedLinkPair (const std::string &link_name1, const std::string &link_name2)
 Create a pair of strings, where the pair.first is always <= pair.second.
 
void tesseract::common::makeOrderedLinkPair (LinkNamesPair &pair, const std::string &link_name1, const std::string &link_name2)
 Populate a pair of strings, where the pair.first is always <= pair.second.
 

Detailed Description

Common Tesseract Types.

Author
Levi Armstrong
Date
January 18, 2018
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ makeOrderedLinkPair() [1/2]

LinkNamesPair tesseract::common::makeOrderedLinkPair ( const std::string &  link_name1,
const std::string &  link_name2 
)

Create a pair of strings, where the pair.first is always <= pair.second.

This is commonly used as the key to an unordered_map<LinkNamesPair, Type>

Parameters
link_name1First link name
link_name2Second link name
Returns
LinkNamesPair a lexicographically sorted pair of strings

◆ makeOrderedLinkPair() [2/2]

void tesseract::common::makeOrderedLinkPair ( LinkNamesPair &  pair,
const std::string &  link_name1,
const std::string &  link_name2 
)

Populate a pair of strings, where the pair.first is always <= pair.second.

This is used to avoid multiple memory application throughout the code base

This is commonly used as the key to an unordered_map<LinkNamesPair, Type>

Parameters
pairThe link name pair to load a lexicographically sorted pair of strings
link_name1First link name
link_name2Second link nam