use crate::math::Transcendental;
use crate::traits::ActivePort;
pub struct GraphExecutor<T: Transcendental, const BUF_SIZE: usize> {
_phantom: std::marker::PhantomData<T>,
}
impl<T: Transcendental, const BUF_SIZE: usize> Default for GraphExecutor<T, BUF_SIZE> {
fn default() -> Self {
Self::new()
}
}
impl<T: Transcendental, const BUF_SIZE: usize> GraphExecutor<T, BUF_SIZE> {
pub fn new() -> Self {
Self {
_phantom: std::marker::PhantomData,
}
}
pub fn process_block(&mut self) -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}
}
pub fn demonstrate_pull<T: Transcendental, const BUF_SIZE: usize>(
port: &mut dyn ActivePort<T, BUF_SIZE>,
) -> Option<[T; BUF_SIZE]> {
port.pull()
}
pub fn demonstrate_push<T: Transcendental, const BUF_SIZE: usize>(
port: &mut dyn ActivePort<T, BUF_SIZE>,
data: [T; BUF_SIZE],
) -> Result<(), crate::traits::PortError> {
port.push(data)
}