Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
srfm::stream::SignalProcessor Class Reference

Signal processing thread owner. Non-copyable, non-movable. More...

#include <signal_processor.hpp>

Public Types

using InRing = SPSCRing< OHLCVTick, IN_RING_SIZE >
 
using OutRing = SPSCRing< StreamRelativisticSignal, OUT_RING_SIZE >
 

Public Member Functions

 SignalProcessor (InRing &in_ring, OutRing &out_ring) noexcept
 Construct bound to the input and output ring buffers.
 
 ~SignalProcessor () noexcept
 
 SignalProcessor (const SignalProcessor &)=delete
 
SignalProcessor & operator= (const SignalProcessor &)=delete
 
 SignalProcessor (SignalProcessor &&)=delete
 
SignalProcessor & operator= (SignalProcessor &&)=delete
 
void start () noexcept
 Launch the processing thread. Idempotent.
 
void stop () noexcept
 Stop and join the processing thread. Idempotent.
 
bool running () const noexcept
 Whether the processing thread is currently running.
 
StreamRelativisticSignal process_one (const OHLCVTick &tick, std::int64_t bar_index) noexcept
 Process one tick synchronously and return the resulting signal.
 
SignalProcessorCounters counters () const noexcept
 
void reset_state () noexcept
 Reset all signal-chain component state.
 

Static Public Attributes

static constexpr std::size_t IN_RING_SIZE = 65536
 
static constexpr std::size_t OUT_RING_SIZE = 65536
 
static constexpr std::size_t NORMALIZER_WINDOW = 20
 

Detailed Description

Signal processing thread owner. Non-copyable, non-movable.

SignalProcessor proc{in_ring, out_ring};
proc.start();
// ...
proc.stop();
Lock-free single-producer / single-consumer ring buffer.
Definition spsc_ring.hpp:85
Signal processing thread owner. Non-copyable, non-movable.

Definition at line 85 of file signal_processor.hpp.

Member Typedef Documentation

◆ InRing

Definition at line 90 of file signal_processor.hpp.

◆ OutRing

Definition at line 91 of file signal_processor.hpp.

Constructor & Destructor Documentation

◆ SignalProcessor() [1/3]

srfm::stream::SignalProcessor::SignalProcessor ( InRing &  in_ring,
OutRing &  out_ring 
)
inlinenoexcept

Construct bound to the input and output ring buffers.

All signal-chain objects are default-constructed here; no allocation occurs in the processing loop.

Parameters
in_ringRing populated by TickIngester (non-owning ref).
out_ringRing consumed by SignalConsumer (non-owning ref).

Definition at line 104 of file signal_processor.hpp.

◆ ~SignalProcessor()

srfm::stream::SignalProcessor::~SignalProcessor ( )
inlinenoexcept

Definition at line 110 of file signal_processor.hpp.

◆ SignalProcessor() [2/3]

srfm::stream::SignalProcessor::SignalProcessor ( const SignalProcessor &  )
delete

◆ SignalProcessor() [3/3]

srfm::stream::SignalProcessor::SignalProcessor ( SignalProcessor &&  )
delete

Member Function Documentation

◆ counters()

SignalProcessorCounters srfm::stream::SignalProcessor::counters ( ) const
inlinenoexcept

Definition at line 146 of file signal_processor.hpp.

◆ operator=() [1/2]

SignalProcessor & srfm::stream::SignalProcessor::operator= ( const SignalProcessor &  )
delete

◆ operator=() [2/2]

SignalProcessor & srfm::stream::SignalProcessor::operator= ( SignalProcessor &&  )
delete

◆ process_one()

StreamRelativisticSignal srfm::stream::SignalProcessor::process_one ( const OHLCVTick &  tick,
std::int64_t  bar_index 
)
noexcept

Process one tick synchronously and return the resulting signal.

Does not push to any ring. Useful for unit tests.

Parameters
tickValidated tick to process.
bar_indexSequence number for this tick.
Returns
The computed StreamRelativisticSignal.

Definition at line 55 of file signal_processor.cpp.

◆ reset_state()

void srfm::stream::SignalProcessor::reset_state ( )
inlinenoexcept

Reset all signal-chain component state.

Must only be called when the processing thread is not running.

Definition at line 157 of file signal_processor.hpp.

◆ running()

bool srfm::stream::SignalProcessor::running ( ) const
inlinenoexcept

Whether the processing thread is currently running.

Definition at line 126 of file signal_processor.hpp.

◆ start()

void srfm::stream::SignalProcessor::start ( )
noexcept

Launch the processing thread. Idempotent.

Definition at line 35 of file signal_processor.cpp.

◆ stop()

void srfm::stream::SignalProcessor::stop ( )
noexcept

Stop and join the processing thread. Idempotent.

Definition at line 46 of file signal_processor.cpp.

Member Data Documentation

◆ IN_RING_SIZE

constexpr std::size_t srfm::stream::SignalProcessor::IN_RING_SIZE = 65536
staticconstexpr

Definition at line 87 of file signal_processor.hpp.

◆ NORMALIZER_WINDOW

constexpr std::size_t srfm::stream::SignalProcessor::NORMALIZER_WINDOW = 20
staticconstexpr

Definition at line 93 of file signal_processor.hpp.

◆ OUT_RING_SIZE

constexpr std::size_t srfm::stream::SignalProcessor::OUT_RING_SIZE = 65536
staticconstexpr

Definition at line 88 of file signal_processor.hpp.


The documentation for this class was generated from the following files: