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::TickIngester Class Reference

Ingestion thread owner. Non-copyable, non-movable. More...

#include <tick_ingester.hpp>

Public Types

using Ring = SPSCRing< OHLCVTick, RING_SIZE >
 

Public Member Functions

 TickIngester (TickSource &source, Ring &ring) noexcept
 Construct bound to a source and a ring buffer.
 
 ~TickIngester () noexcept
 Destructor: ensures the thread is stopped and joined.
 
 TickIngester (const TickIngester &)=delete
 
TickIngester & operator= (const TickIngester &)=delete
 
 TickIngester (TickIngester &&)=delete
 
TickIngester & operator= (TickIngester &&)=delete
 
void start () noexcept
 Launch the ingestion thread.
 
void stop () noexcept
 Signal the ingestion thread to stop and wait for it to finish.
 
bool running () const noexcept
 Whether the ingestion thread is currently running.
 
TickIngesterCounters counters () const noexcept
 Snapshot of ingestion counters.
 

Static Public Attributes

static constexpr std::size_t RING_SIZE = 65536
 

Detailed Description

Ingestion thread owner. Non-copyable, non-movable.

QueueTickSource src;
TickIngester ingester{src, ring};
ingester.start();
src.push(make_valid_tick());
// ... let it run ...
ingester.stop();
Lock-free single-producer / single-consumer ring buffer.
Definition spsc_ring.hpp:85
bool push(T &&item) noexcept
Try to enqueue one element.
Ingestion thread owner. Non-copyable, non-movable.

Definition at line 69 of file tick_ingester.hpp.

Member Typedef Documentation

◆ Ring

Definition at line 72 of file tick_ingester.hpp.

Constructor & Destructor Documentation

◆ TickIngester() [1/3]

srfm::stream::TickIngester::TickIngester ( TickSource &  source,
Ring &  ring 
)
inlinenoexcept

Construct bound to a source and a ring buffer.

Both source and ring must outlive this TickIngester.

Parameters
sourceTick source to read from (non-owning reference).
ringRing buffer to push valid ticks into (non-owning reference).

Definition at line 82 of file tick_ingester.hpp.

◆ ~TickIngester()

srfm::stream::TickIngester::~TickIngester ( )
inlinenoexcept

Destructor: ensures the thread is stopped and joined.

Definition at line 87 of file tick_ingester.hpp.

◆ TickIngester() [2/3]

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

◆ TickIngester() [3/3]

srfm::stream::TickIngester::TickIngester ( TickIngester &&  )
delete

Member Function Documentation

◆ counters()

TickIngesterCounters srfm::stream::TickIngester::counters ( ) const
inlinenoexcept

Snapshot of ingestion counters.

Non-atomic read — approximate under concurrency. Safe for monitoring.

Definition at line 123 of file tick_ingester.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ running()

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

Whether the ingestion thread is currently running.

Definition at line 112 of file tick_ingester.hpp.

◆ start()

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

Launch the ingestion thread.

Idempotent: a second call while running is a no-op.

Definition at line 36 of file tick_ingester.cpp.

◆ stop()

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

Signal the ingestion thread to stop and wait for it to finish.

Idempotent: safe to call multiple times.

Definition at line 48 of file tick_ingester.cpp.

Member Data Documentation

◆ RING_SIZE

constexpr std::size_t srfm::stream::TickIngester::RING_SIZE = 65536
staticconstexpr

Definition at line 71 of file tick_ingester.hpp.


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