feat: Introduce ITValuePublisher interface and refactor indicators for event-driven value updates.

This commit is contained in:
Miha Kralj
2025-12-07 14:36:22 -08:00
parent 3b146b68bd
commit 3734a1c5f6
16 changed files with 572 additions and 177 deletions
+14
View File
@@ -0,0 +1,14 @@
using System;
namespace QuanTAlib;
/// <summary>
/// Interface for objects that publish TValue updates.
/// </summary>
public interface ITValuePublisher
{
/// <summary>
/// Event triggered when a new TValue is available.
/// </summary>
event Action<TValue> Pub;
}
+2 -2
View File
@@ -11,8 +11,8 @@ namespace QuanTAlib;
/// Stores Time (long) and Value (double) in separate contiguous arrays for SIMD efficiency.
/// Supports "New Bar" vs "Update Last" streaming semantics.
/// </summary>
public class TSeries : IReadOnlyList<TValue>
{
public class TSeries : IReadOnlyList<TValue>, ITValuePublisher
{
protected readonly List<long> _t;
protected readonly List<double> _v;