# Objective - First step towards #279 ## Solution Makes the necessary internal data structure changes in order to allow system removal to be added in a future PR: `Vec`s storing systems and system sets in `ScheduleGraph` have been replaced with `SlotMap`s. See the included migration guide for the required changes. ## Testing Internal changes only and no new features *should* mean no new tests are requried.
1.5 KiB
1.5 KiB
| title | pull_requests | |
|---|---|---|
| Schedule SlotMaps |
|
In order to support removing systems from schedules, Vecs storing Systems and
SystemSets have been replaced with SlotMaps which allow safely removing and
reusing indices. The maps are respectively keyed by SystemKeys and SystemSetKeys.
The following signatures were changed:
NodeId::System: Now stores aSystemKeyinstead of a plainusizeNodeId::Set: Now stores aSystemSetKeyinstead of a plainusizeScheduleBuildPass::collapse_set: Now takes the type-specific keys. Wrap them back into aNodeIdif necessary.- The following functions now return the type-specific keys. Wrap them back into a
NodeIdif necessary.Schedule::systemsScheduleGraph::systemsScheduleGraph::system_setsScheduleGraph::conflicting_systems
- Use the appropriate key types to index these structures rather than bare
usizes:ScheduleGraph::systemsfieldScheduleGraph::system_conditions
- The following functions now take the type-specific keys. Use pattern matching to extract them from
NodeIds, if necessary:ScheduleGraph::get_system_atScheduleGraph::system_atScheduleGraph::get_set_atScheduleGraph::set_atScheduleGraph::get_set_conditions_atScheduleGraph::set_conditions_at
The following functions were removed:
NodeId::index: You should match on and use theSystemKeyandSystemSetKeyinstead.NodeId::cmp: Use thePartialOrdandOrdtraits instead.