use crate::eventsdim0::EventsDim0; use crate::eventsdim1::EventsDim1; use crate::Error; use daqbuf_err as err; use items_0::Empty; use items_0::Events; use netpod::log::*; use netpod::EnumVariant; use netpod::ScalarType; use netpod::Shape; pub fn empty_events_dyn_ev(scalar_type: &ScalarType, shape: &Shape) -> Result, Error> { let ret: Box = match shape { Shape::Scalar => { use ScalarType::*; type K = EventsDim0; match scalar_type { U8 => Box::new(K::::empty()), U16 => Box::new(K::::empty()), U32 => Box::new(K::::empty()), U64 => Box::new(K::::empty()), I8 => Box::new(K::::empty()), I16 => Box::new(K::::empty()), I32 => Box::new(K::::empty()), I64 => Box::new(K::::empty()), F32 => Box::new(K::::empty()), F64 => Box::new(K::::empty()), BOOL => Box::new(K::::empty()), STRING => Box::new(K::::empty()), Enum => Box::new(K::::empty()), } } Shape::Wave(..) => { use ScalarType::*; type K = EventsDim1; match scalar_type { U8 => Box::new(K::::empty()), U16 => Box::new(K::::empty()), U32 => Box::new(K::::empty()), U64 => Box::new(K::::empty()), I8 => Box::new(K::::empty()), I16 => Box::new(K::::empty()), I32 => Box::new(K::::empty()), I64 => Box::new(K::::empty()), F32 => Box::new(K::::empty()), F64 => Box::new(K::::empty()), BOOL => Box::new(K::::empty()), STRING => Box::new(K::::empty()), Enum => Box::new(K::::empty()), } } Shape::Image(..) => { error!("TODO empty_events_dyn_ev {scalar_type:?} {shape:?}"); err::todoval() } }; Ok(ret) }