30 if(
auto*
name = std::get_if<NAME_KEY>( &aKey ) )
34 if(
name->scope == SCOPE::GLOBAL )
39 if(
name->scope != SCOPE::PORT )
42 else if(
const auto* record = std::get_if<RECORD_NODE>( &aKey ) )
48 Instance( std::get<SLOT_KEY>( aKey ).bundleDriver.inst );
56 size_t hash = aKey.index();
58 if(
const auto* record = std::get_if<RECORD_NODE>( &aKey ) )
61 hash =
KiHashCombine( hash, std::hash<KIID>{}( record->record.anchor ) );
62 hash =
KiHashCombine( hash,
static_cast<size_t>( record->kind ) );
64 else if(
const auto*
name = std::get_if<NAME_KEY>( &aKey ) )
69 if(
name->scope != SCOPE::GLOBAL )
72 if(
name->scope == SCOPE::PORT )
77 const auto& slot = std::get<SLOT_KEY>( aKey );
78 hash =
KiHashCombine( hash, std::hash<KIID>{}( slot.bundleDriver.item ) );
89 std::optional<bool> unsetIdLess( uint32_t aLeft, uint32_t aRight )
106 if( std::optional<bool> order = unsetIdLess( aLeft.
inst, aRight.
inst ) )
117 if( std::optional<bool> order = unsetIdLess( aLeft.
inst, aRight.
inst ) )
133 if( aLeft.
scope != SCOPE::GLOBAL && aLeft.
inst != aRight.
inst )
135 if( std::optional<bool> order = unsetIdLess( aLeft.
inst, aRight.
inst ) )
143 if( std::optional<bool> order = unsetIdLess( aLeft.
text, aRight.
text ) )
149 return aLeft.
scope == SCOPE::PORT && aLeft.
kind < aRight.
kind;
160 if( aLeft.index() != aRight.index() )
161 return aLeft.index() < aRight.index();
164 [&](
const auto&
left )
166 return Less(
left, std::get<std::decay_t<
decltype(
left )>>( aRight ) );
const wxString & Name(NAME_ID aId) const
const KIID_PATH & Instance(INST_ID aId) const
INTERN_TABLE< NODE_KEY, std::unordered_map< NODE_KEY, uint32_t, NODE_HASH > > m_nodes
bool Less(const ITEM_KEY &aLeft, const ITEM_KEY &aRight) const
bool NameLess(NAME_ID aLeft, NAME_ID aRight) const
NODE_ID InternNode(NODE_KEY aKey)
std::size_t KiHashCombine(std::size_t aSeed, std::size_t aValue)
Fold aValue into the running hash aSeed using the well-known Boost hash_combine mixing step.
Value keys and the key session of the schematic connectivity engine.
std::variant< RECORD_NODE, NAME_KEY, SLOT_KEY > NODE_KEY
Any node of the union-find graph.
uint32_t NODE_ID
Session handle of a NODE_KEY graph node.
constexpr uint32_t INVALID_ID
Marks an unset handle.
One item or pin in one sheet instance.
KIID item
The item or pin KIID.
INST_ID inst
The sheet instance that shows the item.
The graph node of one name in one scope.
KIND kind
The record kind. Only PORT compares it.
INST_ID inst
The sheet instance, or the child instance of a sheet pin for PORT.
NAME_ID text
The resolved name.
One island in one sheet instance.
INST_ID inst
The sheet instance of the record.
KIID anchor
ISLAND::anchor, the smallest item KIID in the island.
The graph node of one island record.
KIND kind
The kind of the record, which selects its stratum.
size_t operator()(const NODE_KEY &aKey) const
One member position of a bus.
ITEM_KEY bundleDriver
The source item of the claim that defines the leaf order.
uint32_t leaf
The index into BUS_SCHEMA::leaves of that claim.