Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
Loading...
Searching...
No Matches
slick::sim::md_feed::detail::CaptureStream Class Reference

A capture file's bytes: as stored, or decompressed on the fly from .zst (zstd) or .gz (gzip, members back to back included). More...

#include <md_feed/pcap_reader.hpp>

Collaboration diagram for slick::sim::md_feed::detail::CaptureStream:

Public Member Functions

 CaptureStream (const std::string &path)
 Throws std::runtime_error when the file cannot be opened.
 ~CaptureStream ()
 CaptureStream (const CaptureStream &)=delete
CaptureStream & operator= (const CaptureStream &)=delete
size_t read (uint8_t *dst, size_t size)
 Fills dst with up to size bytes, short only at the end of the stream or on an error, which error() then names.
const std::string & error () const noexcept
 Empty unless reading or decompressing failed: a truncated or corrupt archive.

Detailed Description

A capture file's bytes: as stored, or decompressed on the fly from .zst (zstd) or .gz (gzip, members back to back included).

Not thread-safe.

Definition at line 90 of file pcap_reader.hpp.

Constructor & Destructor Documentation

◆ CaptureStream() [1/2]

slick::sim::md_feed::detail::CaptureStream::CaptureStream ( const std::string & path)
inlineexplicit

Throws std::runtime_error when the file cannot be opened.

Definition at line 93 of file pcap_reader.hpp.

References slick::sim::md_feed::detail::errno_text(), slick::sim::md_feed::detail::has_suffix(), and slick::sim::md_feed::detail::open_shared().

Referenced by CaptureStream(), and operator=().

◆ ~CaptureStream()

slick::sim::md_feed::detail::CaptureStream::~CaptureStream ( )
inline

Definition at line 114 of file pcap_reader.hpp.

◆ CaptureStream() [2/2]

slick::sim::md_feed::detail::CaptureStream::CaptureStream ( const CaptureStream & )
delete

References CaptureStream().

Member Function Documentation

◆ error()

const std::string & slick::sim::md_feed::detail::CaptureStream::error ( ) const
inlinenodiscardnoexcept

Empty unless reading or decompressing failed: a truncated or corrupt archive.

Definition at line 142 of file pcap_reader.hpp.

◆ operator=()

CaptureStream & slick::sim::md_feed::detail::CaptureStream::operator= ( const CaptureStream & )
delete

References CaptureStream().

◆ read()

size_t slick::sim::md_feed::detail::CaptureStream::read ( uint8_t * dst,
size_t size )
inline

Fills dst with up to size bytes, short only at the end of the stream or on an error, which error() then names.

Definition at line 129 of file pcap_reader.hpp.


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