Trait Component

Source
pub unsafe trait Component {
    type Input: Bag;
    type Output: Bag;

    // Required methods
    fn get_t_last(&self) -> f64;
    fn set_t_last(&mut self, t_last: f64);
    fn get_t_next(&self) -> f64;
    fn set_t_next(&mut self, t_next: f64);
    fn get_input(&self) -> &Self::Input;
    fn get_input_mut(&mut self) -> &mut Self::Input;
    fn get_output(&self) -> &Self::Output;
    fn get_output_mut(&mut self) -> &mut Self::Output;

    // Provided methods
    fn clear_input(&mut self) { ... }
    fn clear_output(&mut self) { ... }
}
Expand description

Interface for DEVS components. All DEVS components must implement this trait.

§Safety

This trait must be implemented via macros. Do not implement it manually.

Required Associated Types§

Source

type Input: Bag

Input event bag of the model.

Source

type Output: Bag

Output event bag of the model.

Required Methods§

Source

fn get_t_last(&self) -> f64

Returns the last time the component was updated.

Source

fn set_t_last(&mut self, t_last: f64)

Sets the last time the component was updated.

Source

fn get_t_next(&self) -> f64

Returns the next time the component will be updated.

Source

fn set_t_next(&mut self, t_next: f64)

Sets the next time the component will be updated.

Source

fn get_input(&self) -> &Self::Input

Returns a reference to the model’s input event bag.

Source

fn get_input_mut(&mut self) -> &mut Self::Input

Returns a mutable reference to the model’s input event bag.

Source

fn get_output(&self) -> &Self::Output

Returns a reference to the model’s output event bag.

Source

fn get_output_mut(&mut self) -> &mut Self::Output

Returns a mutable reference to the model’s output event bag.

Provided Methods§

Source

fn clear_input(&mut self)

Clears the input bag, removing all values.

Source

fn clear_output(&mut self)

Clears the output bag, removing all values.

Implementors§