@@ -8,22 +8,37 @@ use fixedbitset::FixedBitSet;
8
8
9
9
use crate :: schedule:: set:: * ;
10
10
11
+ /// Unique identifier for a system set stored in a [`ScheduleGraph`].
12
+ #[ derive( Debug , Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
13
+ pub struct SystemNodeId ( pub usize ) ;
14
+
15
+ /// Unique identifier for a system set stored in a [`ScheduleGraph`].
16
+ #[ derive( Debug , Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
17
+ pub struct SystemSetNodeId ( pub usize ) ;
18
+
11
19
/// Unique identifier for a system or system set stored in a [`ScheduleGraph`].
12
20
///
13
21
/// [`ScheduleGraph`]: super::ScheduleGraph
14
22
#[ derive( Debug , Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
15
23
pub enum NodeId {
16
24
/// Identifier for a system.
17
- System ( usize ) ,
25
+ System ( SystemNodeId ) ,
18
26
/// Identifier for a system set.
19
- Set ( usize ) ,
27
+ Set ( SystemSetNodeId ) ,
20
28
}
21
29
22
30
impl NodeId {
23
- /// Returns the internal integer value.
24
- pub ( crate ) fn index ( & self ) -> usize {
31
+ pub ( crate ) fn system ( & self ) -> Option < SystemNodeId > {
32
+ match self {
33
+ NodeId :: System ( node) => Some ( * node) ,
34
+ NodeId :: Set ( _) => None ,
35
+ }
36
+ }
37
+
38
+ pub ( crate ) fn set ( & self ) -> Option < SystemSetNodeId > {
25
39
match self {
26
- NodeId :: System ( index) | NodeId :: Set ( index) => * index,
40
+ NodeId :: System ( _) => None ,
41
+ NodeId :: Set ( node) => Some ( * node) ,
27
42
}
28
43
}
29
44
0 commit comments