Tesseract 0.28.4
Loading...
Searching...
No Matches
tesseract::common::NameIdTestAccess Struct Reference

Test-only access to NameId internals; NameId declares this a friend. More...

#include <name_id_testing.h>

Static Public Member Functions

template<typename IdT>
static IdT create (std::size_t value, const std::string &name)
 Construct an id with an explicit value/name combination, e.g. a manufactured hash collision.
template<typename IdT>
static std::pair< IdT, IdT > createReverseCanonical (const std::string &alphabetically_first, const std::string &alphabetically_second)
 Two ids whose canonical pair order is the reverse of their alphabetical order.

Detailed Description

Test-only access to NameId internals; NameId declares this a friend.

Member Function Documentation

◆ createReverseCanonical()

template<typename IdT>
std::pair< IdT, IdT > tesseract::common::NameIdTestAccess::createReverseCanonical ( const std::string & alphabetically_first,
const std::string & alphabetically_second )
inlinestaticnodiscard

Two ids whose canonical pair order is the reverse of their alphabetical order.

OrderedIdPair canonicalizes by hash value, so a test that must tell canonical order apart from alphabetical order cannot use real hashes — those move with the boost version. The values here are injected so that OrderedIdPair(first, second).first() is the alphabetically later name.