Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
Loading...
Searching...
No Matches
Classes | Namespaces
stream_engine.hpp File Reference

StreamEngine — top-level owner of the lock-free streaming pipeline. More...

#include "../stream/signal_consumer.hpp"
#include "../stream/signal_processor.hpp"
#include "../stream/spsc_ring.hpp"
#include "../stream/stream_signal.hpp"
#include "../stream/tick.hpp"
#include "../stream/tick_ingester.hpp"
#include "../stream/tick_source.hpp"
#include <atomic>
#include <cstdint>
#include <cstdio>

Go to the source code of this file.

Classes

class  srfm::engine::StreamEngine
 Top-level streaming pipeline owner. Non-copyable, non-movable. More...
 

Namespaces

namespace  srfm
 
namespace  srfm::engine
 

Detailed Description

StreamEngine — top-level owner of the lock-free streaming pipeline.

Module: include/srfm/engine/ Owner: AGT-10 (Builder) — 2026-03-01

Responsibility

Own and coordinate the three threads and two ring buffers that form the streaming pipeline:

TickSource → [TickIngester] → Ring1<OHLCVTick> → [SignalProcessor] → Ring2<StreamRelativisticSignal> → [SignalConsumer] → stdout (or configured sink)

Provide a test-injection path (inject()) that bypasses the TickSource and pushes ticks directly into Ring1 from the calling thread.

Guarantees

• Owns Ring1 and Ring2 (inline storage — no heap allocation for rings). • start() / stop() are idempotent. • Graceful shutdown: stop() signals all threads and joins them in order. • inject() is safe to call from any thread while the engine is running, provided only one external thread calls inject() (SPSC constraint on Ring1).

NOT Responsible For

• Tick validation (TickIngester) • Signal computation (SignalProcessor) • JSON formatting (SignalConsumer)

QueueTickSource src;
StreamEngine engine{src};
engine.start();
engine.inject(make_valid_tick());
// let it process...
engine.stop();

Definition in file stream_engine.hpp.