
# 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, Vec
s storing System
s and
SystemSet
s have been replaced with SlotMap
s which allow safely removing and
reusing indices. The maps are respectively keyed by SystemKey
s and SystemSetKey
s.
The following signatures were changed:
NodeId::System
: Now stores aSystemKey
instead of a plainusize
NodeId::Set
: Now stores aSystemSetKey
instead of a plainusize
ScheduleBuildPass::collapse_set
: Now takes the type-specific keys. Wrap them back into aNodeId
if necessary.- The following functions now return the type-specific keys. Wrap them back into a
NodeId
if necessary.Schedule::systems
ScheduleGraph::systems
ScheduleGraph::system_sets
ScheduleGraph::conflicting_systems
- Use the appropriate key types to index these structures rather than bare
usize
s:ScheduleGraph::systems
fieldScheduleGraph::system_conditions
- The following functions now take the type-specific keys. Use pattern matching to extract them from
NodeId
s, if necessary:ScheduleGraph::get_system_at
ScheduleGraph::system_at
ScheduleGraph::get_set_at
ScheduleGraph::set_at
ScheduleGraph::get_set_conditions_at
ScheduleGraph::set_conditions_at
The following functions were removed:
NodeId::index
: You should match on and use theSystemKey
andSystemSetKey
instead.NodeId::cmp
: Use thePartialOrd
andOrd
traits instead.