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

Tick source that reads raw OHLCVTick bytes from a named pipe / FIFO. More...

#include <tick_source.hpp>

Inheritance diagram for srfm::stream::PipeTickSource:
srfm::stream::TickSource

Public Member Functions

 PipeTickSource (const std::string &name, unsigned int timeout_ms=5000) noexcept
 Open the named pipe / FIFO for reading.
 
 ~PipeTickSource () noexcept override
 
std::optional< OHLCVTick > read () noexcept override
 Read the next OHLCVTick from the source.
 
bool is_open () const noexcept override
 Whether the source is still usable.
 
void close () noexcept override
 Close the source and release any OS resources.
 
- Public Member Functions inherited from srfm::stream::TickSource
virtual ~TickSource () noexcept=default
 

Detailed Description

Tick source that reads raw OHLCVTick bytes from a named pipe / FIFO.

Wire protocol: little-endian binary, exactly sizeof(OHLCVTick) bytes per tick. No framing header — the ingester detects malformed ticks via tick_is_valid().

On Windows: uses a named pipe (\\.\pipe\<name>). On POSIX: uses a named FIFO at path <name>.

Definition at line 159 of file tick_source.hpp.

Constructor & Destructor Documentation

◆ PipeTickSource()

srfm::stream::PipeTickSource::PipeTickSource ( const std::string &  name,
unsigned int  timeout_ms = 5000 
)
inlineexplicitnoexcept

Open the named pipe / FIFO for reading.

Parameters
namePipe name (Windows) or FIFO path (POSIX). Windows: omit the \.\pipe\ prefix — it is added automatically. POSIX: full path, e.g. "/tmp/srfm_ticks".

On Windows, waits up to timeout_ms for the server to create the pipe. On POSIX, the FIFO must already exist (call mkfifo before constructing).

Definition at line 171 of file tick_source.hpp.

◆ ~PipeTickSource()

srfm::stream::PipeTickSource::~PipeTickSource ( )
inlineoverridenoexcept

Definition at line 176 of file tick_source.hpp.

Member Function Documentation

◆ close()

void srfm::stream::PipeTickSource::close ( )
inlineoverridevirtualnoexcept

Close the source and release any OS resources.

Safe to call multiple times.

Implements srfm::stream::TickSource.

Definition at line 199 of file tick_source.hpp.

◆ is_open()

bool srfm::stream::PipeTickSource::is_open ( ) const
inlineoverridevirtualnoexcept

Whether the source is still usable.

Returns false after a permanent error or after close() is called.

Implements srfm::stream::TickSource.

Definition at line 191 of file tick_source.hpp.

◆ read()

std::optional< OHLCVTick > srfm::stream::PipeTickSource::read ( )
inlineoverridevirtualnoexcept

Read the next OHLCVTick from the source.

Returns
std::optional<OHLCVTick>:
  • has_value() → a tick was read; it may or may not pass validation.
  • nullopt → no data available right now (transient) or source closed (permanent — caller checks is_open()).
Note
Implementations must not throw.

Implements srfm::stream::TickSource.

Definition at line 178 of file tick_source.hpp.


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