include origin into system name

This commit is contained in:
Marcel Märtens
2021-04-07 01:20:26 +02:00
parent 425063e24e
commit 485a477503
3 changed files with 16 additions and 3 deletions

View File

@ -30,6 +30,17 @@ pub enum Origin {
Frontend(&'static str),
}
impl Origin {
fn name(&self) -> &'static str {
match self {
Origin::Common => "Common",
Origin::Client => "Client",
Origin::Server => "Server",
Origin::Frontend(name) => name,
}
}
}
#[derive(Default, Debug, Clone)]
pub struct CpuTimeline {
/// measurements for a System
@ -234,7 +245,7 @@ pub trait System<'a> {
type SystemData: specs::SystemData<'a>;
fn run(job: &mut Job<Self>, data: Self::SystemData);
fn sys_name() -> String { format!("{}_sys", Self::NAME) }
fn sys_name() -> String { format!("{}_{}_sys", Self::ORIGIN.name(), Self::NAME) }
}
pub fn dispatch<'a, 'b, T>(builder: &mut specs::DispatcherBuilder<'a, 'b>, dep: &[&str])