public ReturnCode_t DeactivateComponent(LightweightRTObject comp)
        {
            _executor.Dispose();

            _state = LifeCycleState.INACTIVE_STATE;

            _component.OnDeactivated(0);

            return ReturnCode_t.RTC_OK;
        }
        public ReturnCode_t reset_component(LightweightRTObject comp)
        {
            var mock = comp as RTObjectMock;

            if (mock.State == LifeCycleState.ERROR_STATE)
            {
                mock.State = LifeCycleState.INACTIVE_STATE;
                return ReturnCode_t.RTC_OK;
            }
            else
            {
                return ReturnCode_t.PRECONDITION_NOT_MET;
            }
        }
        public ReturnCode_t ActivateComponent(LightweightRTObject comp)
        {
            Observable.Start(() =>
            {
                _state = LifeCycleState.ACTIVE_STATE;
                _component.OnActivated(0);
            }, ExecutionContextScheduler)
            .Subscribe(_ =>
            {
                _executor = Observable
                    .Interval(_timeSpan, ExecutionContextScheduler)
                    .Subscribe(__ => _component.OnExecute(0));
            });

            return ReturnCode_t.RTC_OK;
        }
 public LightweightRTObjectAdapter(LightweightRTObject target)
 {
     _target = target;
 }
 public LifeCycleState GetComponentState(LightweightRTObject comp)
 {
     return _state;
 }
 public ReturnCode_t AddComponent(LightweightRTObject comp)
 {
     _component = (DataFlowComponent)comp;
     return ReturnCode_t.RTC_OK;
 }
 public ReturnCode_t ResetComponent(LightweightRTObject comp)
 {
     throw new NotImplementedException();
 }
 public ReturnCode_t RemoveComponent(LightweightRTObject comp)
 {
     _component = null;
     return ReturnCode_t.RTC_OK;
 }
 public LifeCycleState get_component_state(LightweightRTObject comp)
 {
     var mock = comp as RTObjectMock;
     return mock.State;
 }