@@ -140,9 +140,10 @@ namespace hgraph
140140 struct TSWindowDispatch : TSDispatch
141141 {
142142 [[nodiscard]] const TSWindowDispatch *as_window () const noexcept override { return this ; }
143- [[nodiscard]] virtual size_t size (const TSViewContext &context) const noexcept = 0;
144- [[nodiscard]] virtual Range<View> values (const TSViewContext &context) const noexcept = 0;
145- [[nodiscard]] virtual Range<engine_time_t > value_times (const TSViewContext &context) const noexcept = 0;
143+ [[nodiscard]] virtual size_t size (const TSViewContext &context, engine_time_t evaluation_time) const noexcept = 0;
144+ [[nodiscard]] virtual Range<View> values (const TSViewContext &context, engine_time_t evaluation_time) const noexcept = 0;
145+ [[nodiscard]] virtual Range<engine_time_t > value_times (const TSViewContext &context,
146+ engine_time_t evaluation_time) const noexcept = 0;
146147 };
147148
148149 struct TSInputViewOps
@@ -254,11 +255,15 @@ namespace hgraph
254255 resolved_context.value_dispatch = target_context.value_dispatch ;
255256 resolved_context.ts_dispatch = target_context.ts_dispatch ;
256257 resolved_context.value_data = target_context.value_data ;
258+ resolved_context.owning_output = target.owning_output != nullptr ? target.owning_output : resolved_context.owning_output ;
259+ resolved_context.output_view_ops = target.output_view_ops != nullptr ? target.output_view_ops : resolved_context.output_view_ops ;
260+ resolved_context.notification_state =
261+ target.notification_state != nullptr ? target.notification_state : resolved_context.notification_state ;
257262 };
258263
259264 if (const LinkedTSContext *target = state->linked_target (); target != nullptr ) { apply_target (*target); }
260265
261- return resolved_context;
266+ return detail::refresh_native_context ( resolved_context) ;
262267 }
263268
264269 [[nodiscard]] View value () const noexcept
@@ -1044,15 +1049,15 @@ namespace hgraph
10441049 {
10451050 const auto *dispatch = this ->view_ref ().context_ref ().resolved ().ts_dispatch ;
10461051 const auto *window_dispatch = dispatch != nullptr ? dispatch->as_window () : nullptr ;
1047- return window_dispatch != nullptr ? window_dispatch->size (this ->view_ref ().context_ref ()) : 0 ;
1052+ return window_dispatch != nullptr ? window_dispatch->size (this ->view_ref ().context_ref (), this -> view_ref (). evaluation_time () ) : 0 ;
10481053 }
10491054
10501055 template <typename TView>
10511056 Range<View> TSWView<TView>::values() const noexcept
10521057 {
10531058 const auto *dispatch = this ->view_ref ().context_ref ().resolved ().ts_dispatch ;
10541059 const auto *window_dispatch = dispatch != nullptr ? dispatch->as_window () : nullptr ;
1055- return window_dispatch != nullptr ? window_dispatch->values (this ->view_ref ().context_ref ())
1060+ return window_dispatch != nullptr ? window_dispatch->values (this ->view_ref ().context_ref (), this -> view_ref (). evaluation_time () )
10561061 : Range<View>{nullptr , 0 , nullptr , nullptr };
10571062 }
10581063
@@ -1061,7 +1066,7 @@ namespace hgraph
10611066 {
10621067 const auto *dispatch = this ->view_ref ().context_ref ().resolved ().ts_dispatch ;
10631068 const auto *window_dispatch = dispatch != nullptr ? dispatch->as_window () : nullptr ;
1064- return window_dispatch != nullptr ? window_dispatch->value_times (this ->view_ref ().context_ref ())
1069+ return window_dispatch != nullptr ? window_dispatch->value_times (this ->view_ref ().context_ref (), this -> view_ref (). evaluation_time () )
10651070 : Range<engine_time_t >{nullptr , 0 , nullptr , nullptr };
10661071 }
10671072
0 commit comments