use crate::Client;
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct PlotName(pub(crate) &'static str);
impl Client {
pub fn plot(&self, plot_name: PlotName, value: f64) {
#[cfg(feature = "enable")]
unsafe {
sys::___tracy_emit_plot(plot_name.0.as_ptr().cast(), value);
}
}
}
#[macro_export]
macro_rules! plot_name {
($name: literal) => {
unsafe { $crate::internal::create_plot(concat!($name, "\0")) }
};
}
#[macro_export]
macro_rules! plot {
($name: literal, $value: expr) => {{
$crate::Client::running()
.expect("plot! without a running Client")
.plot($crate::plot_name!($name), $value)
}};
}