32 wxASSERT( wxThread::IsMain() );
33 std::map<KIID_PATH, std::pair<const SCH_SHEET_PATH*, size_t>> paths;
37 if(
path.empty() || !
path.LastScreen() )
40 if( !paths.try_emplace(
path.Path(), &
path, 0 ).second )
41 throw std::invalid_argument(
"Connectivity hierarchy has duplicate instance paths" );
44 std::vector<FRAME_INSTANCE>
result;
45 result.reserve( paths.size() );
47 for(
auto& [key, entry] : paths )
51 if(
path->size() > std::numeric_limits<uint16_t>::max() )
52 throw std::overflow_error(
"Connectivity hierarchy depth exhausted" );
56 scope.
path =
path->PathHumanReadable(
true,
false,
true );
57 scope.
depth =
static_cast<uint16_t
>(
path->size() );
63 if(
const auto found = paths.find( parent ); found != paths.end() )
64 result[found->second.second].scope.children.emplace( key.back(), scope.
instance );
66 result.push_back( { std::move( scope ),
path->LastScreen()->ConnectivityId() } );
std::vector< FRAME_INSTANCE > CaptureHierarchy(const SCH_SHEET_LIST &aPaths, SESSION_KEYS &aKeys)
Interns every sheet instance and returns the frame in KIID_PATH order, so each parent precedes its ch...
wxString result
Test unit parsing edge cases and error handling.