Files
@ be8ea413a49a
Branch filter:
Location: CSY/reowolf/src/runtime2/component/component_ip.rs - annotation
be8ea413a49a
1.3 KiB
application/rls-services+xml
Initial (failing) implementation of builtin component
a5594f90afa6 a5594f90afa6 a5594f90afa6 be8ea413a49a a5594f90afa6 a5594f90afa6 a5594f90afa6 be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a a5594f90afa6 a5594f90afa6 be8ea413a49a a5594f90afa6 a5594f90afa6 a5594f90afa6 a5594f90afa6 a5594f90afa6 a5594f90afa6 a5594f90afa6 a5594f90afa6 a5594f90afa6 a5594f90afa6 a5594f90afa6 be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a be8ea413a49a a5594f90afa6 | use crate::protocol::eval::*;
use crate::runtime2::*;
use super::*;
use super::component::*;
/// TODO: Temporary component to figure out what to do with custom components.
/// This component sends random numbers between two u32 limits
pub struct ComponentRandomU32 {
output_port_id: PortId,
random_minimum: u32,
random_maximum: u32,
}
impl Component for ComponentRandomU32 {
fn adopt_message(&mut self, _comp_ctx: &mut CompCtx, _message: DataMessage) {
unreachable!("should not adopt messages");
}
fn handle_message(&mut self, sched_ctx: &mut SchedulerCtx, comp_ctx: &mut CompCtx, message: Message) {
todo!()
}
fn run(&mut self, sched_ctx: &mut SchedulerCtx, comp_ctx: &mut CompCtx) -> Result<CompScheduling, EvalError> {
todo!()
}
}
impl ComponentRandomU32 {
pub(crate) fn new(arguments: ValueGroup) -> Self {
debug_assert_eq!(arguments.values.len(), 3);
debug_assert!(arguments.regions.is_empty());
let port_id = port_id_from_eval(arguments.values[0].as_port_id());
let minimum = arguments.values[1].as_uint32();
let maximum = arguments.values[2].as_uint32();
return ComponentRandomU32{
output_port_id: port_id,
random_minimum: minimum,
random_maximum: maximum,
}
}
}
|