Skip to main content

ExecutionContextOperations

Trait ExecutionContextOperations 

Source
pub trait ExecutionContextOperations {
    // Required methods
    fn is_running(&self) -> bool;
    fn start(&mut self) -> ReturnCode;
    fn stop(&mut self) -> ReturnCode;
    fn get_rate(&self) -> f64;
    fn set_rate(&mut self, rate: f64) -> ReturnCode;
    fn add_component(
        &mut self,
        component: &mut LightweightRtObject,
    ) -> Result<ExecutionContextHandle, ReturnCode>;
    fn remove_component(
        &mut self,
        component: &mut LightweightRtObject,
        handle: ExecutionContextHandle,
    ) -> ReturnCode;
    fn activate_component(
        &mut self,
        component: &mut LightweightRtObject,
        handle: ExecutionContextHandle,
    ) -> ReturnCode;
    fn deactivate_component(
        &mut self,
        component: &mut LightweightRtObject,
        handle: ExecutionContextHandle,
    ) -> ReturnCode;
    fn reset_component(
        &mut self,
        component: &mut LightweightRtObject,
        handle: ExecutionContextHandle,
    ) -> ReturnCode;
    fn get_component_state(
        &self,
        component: &LightweightRtObject,
        handle: ExecutionContextHandle,
    ) -> LifeCycleState;
    fn get_kind(&self) -> ExecutionKind;
}
Expand description

ExecutionContext Trait — Spec §5.2.2.5 (S. 22-23).

“An ExecutionContext allows the business logic of an RTC to be decoupled from the thread of control in which it is executed.”

Diese Trait definiert die externe Sicht; konkrete Realisationen erben davon. Der Body der Trait ist die ExecutionContextOperations- Iface aus Spec §5.2.2.6.

Required Methods§

Source

fn is_running(&self) -> bool

Spec §5.2.2.6.1 — is_running.

Source

fn start(&mut self) -> ReturnCode

Spec §5.2.2.6.2 — start. Stopped → Running.

Source

fn stop(&mut self) -> ReturnCode

Spec §5.2.2.6.3 — stop. Running → Stopped.

Source

fn get_rate(&self) -> f64

Spec §5.2.2.6.4 — get_rate. Tick-Rate in Hz.

Source

fn set_rate(&mut self, rate: f64) -> ReturnCode

Spec §5.2.2.6.5 — set_rate(rate).

§Errors

BAD_PARAMETER wenn rate <= 0.0 oder NaN.

Source

fn add_component( &mut self, component: &mut LightweightRtObject, ) -> Result<ExecutionContextHandle, ReturnCode>

Spec §5.2.2.6.6 — add_component.

§Errors

Liefert ReturnCode::Err wenn das RTC nicht alive ist oder schon im Context registriert.

Source

fn remove_component( &mut self, component: &mut LightweightRtObject, handle: ExecutionContextHandle, ) -> ReturnCode

Spec §5.2.2.6.7 — remove_component.

Source

fn activate_component( &mut self, component: &mut LightweightRtObject, handle: ExecutionContextHandle, ) -> ReturnCode

Spec §5.2.2.6.8 — activate_component.

Source

fn deactivate_component( &mut self, component: &mut LightweightRtObject, handle: ExecutionContextHandle, ) -> ReturnCode

Spec §5.2.2.6.9 — deactivate_component.

Source

fn reset_component( &mut self, component: &mut LightweightRtObject, handle: ExecutionContextHandle, ) -> ReturnCode

Spec §5.2.2.6.10 — reset_component.

Source

fn get_component_state( &self, component: &LightweightRtObject, handle: ExecutionContextHandle, ) -> LifeCycleState

Spec §5.2.2.6.11 — get_component_state.

Source

fn get_kind(&self) -> ExecutionKind

Spec §5.2.2.6.12 — get_kind.

Implementors§