rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
rogue::utilities::fileio::StreamReader Class Reference

Reads Rogue stream data files and emits frames on stream master interface. More...

#include <StreamReader.h>

Inheritance diagram for rogue::utilities::fileio::StreamReader:
rogue::interfaces::stream::Master rogue::EnableSharedFromThis< rogue::interfaces::stream::Master > rogue::EnableSharedFromThisBase

Public Member Functions

 StreamReader ()
 Constructs a stream reader instance.
 
 ~StreamReader ()
 Destroys stream reader and closes active file/thread.
 
void open (std::string file)
 Opens a file and starts background read processing.
 
void close ()
 Stops read thread and closes active file immediately.
 
bool isOpen ()
 Returns whether a file descriptor is currently open.
 
void closeWait ()
 Waits for read activity to complete, then closes file/thread.
 
bool isActive ()
 Returns read activity state.
 
- Public Member Functions inherited from rogue::interfaces::stream::Master
 Master ()
 Constructs a stream master.
 
virtual ~Master ()
 Destroys the stream master.
 
uint32_t slaveCount ()
 Returns the number of attached slaves.
 
void addSlave (std::shared_ptr< rogue::interfaces::stream::Slave > slave)
 Attaches a downstream slave.
 
std::shared_ptr< rogue::interfaces::stream::FramereqFrame (uint32_t size, bool zeroCopyEn)
 Requests allocation of a new frame from the primary slave.
 
void sendFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Sends a frame to all attached slaves.
 
bool ensureSingleBuffer (std::shared_ptr< rogue::interfaces::stream::Frame > &frame, bool reqEn)
 Ensures a frame is represented by a single buffer.
 
virtual void stop ()
 Stops frame generation and shuts down associated threads.
 
void equalsPy (boost::python::object p)
 Supports == operator usage from Python.
 
boost::python::object rshiftPy (boost::python::object p)
 Supports >> operator usage from Python.
 
void operator== (std::shared_ptr< rogue::interfaces::stream::Slave > &other)
 Supports == operator usage in C++.
 
std::shared_ptr< rogue::interfaces::stream::Slave > & operator>> (std::shared_ptr< rogue::interfaces::stream::Slave > &other)
 Connects this master to a slave via stream chaining operator.
 
- Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Master >
std::shared_ptr< rogue::interfaces::stream::Mastershared_from_this ()
 Returns a shared_ptr<T> for this instance.
 
- Public Member Functions inherited from rogue::EnableSharedFromThisBase
virtual ~EnableSharedFromThisBase ()
 Virtual destructor for polymorphic base usage.
 

Static Public Member Functions

static std::shared_ptr< rogue::utilities::fileio::StreamReadercreate ()
 Creates a stream reader instance.
 
static void setup_python ()
 Registers Python bindings for this class.
 
- Static Public Member Functions inherited from rogue::interfaces::stream::Master
static std::shared_ptr< rogue::interfaces::stream::Mastercreate ()
 Creates a stream master.
 
static void setup_python ()
 Registers this type with Python bindings.
 

Detailed Description

Reads Rogue stream data files and emits frames on stream master interface.

StreamReader opens a file (or indexed file sequence) created by Rogue file writer utilities, parses frame headers/metadata, reconstructs stream frames, and forwards them downstream via sendFrame().

File sequence behavior:

Read activity runs in a background thread while isActive() is true.

Definition at line 51 of file StreamReader.h.

Constructor & Destructor Documentation

◆ StreamReader()

rogue::utilities::fileio::StreamReader::StreamReader ( )

Constructs a stream reader instance.

Creator.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

Definition at line 65 of file StreamReader.cpp.

◆ ~StreamReader()

rogue::utilities::fileio::StreamReader::~StreamReader ( )

Destroys stream reader and closes active file/thread.

Deconstructor.

Definition at line 72 of file StreamReader.cpp.

Member Function Documentation

◆ close()

void rogue::utilities::fileio::StreamReader::close ( )

Stops read thread and closes active file immediately.

Close a data file.

Definition at line 125 of file StreamReader.cpp.

◆ closeWait()

void rogue::utilities::fileio::StreamReader::closeWait ( )

Waits for read activity to complete, then closes file/thread.

Close when done.

Definition at line 148 of file StreamReader.cpp.

◆ create()

rogue::utilities::fileio::StreamReaderPtr rogue::utilities::fileio::StreamReader::create ( )
static

Creates a stream reader instance.

Class creation.

This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.

Returns
Shared pointer to the created reader.

Company : SLAC National Accelerator Laboratory

Description :

Class to read data files.

This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms

contained in the LICENSE.txt file.

Definition at line 46 of file StreamReader.cpp.

◆ isActive()

bool rogue::utilities::fileio::StreamReader::isActive ( )

Returns read activity state.

Return true when done.

Returns
true while background reader is active.

Definition at line 156 of file StreamReader.cpp.

◆ isOpen()

bool rogue::utilities::fileio::StreamReader::isOpen ( )

Returns whether a file descriptor is currently open.

Get open status.

Returns
true if file is open; otherwise false.

Definition at line 132 of file StreamReader.cpp.

◆ open()

void rogue::utilities::fileio::StreamReader::open ( std::string  file)

Opens a file and starts background read processing.

Open a data file.

Parameters
fileInput data filename.

Definition at line 77 of file StreamReader.cpp.

◆ setup_python()

void rogue::utilities::fileio::StreamReader::setup_python ( )
static

Registers Python bindings for this class.

Setup class in python.

Definition at line 52 of file StreamReader.cpp.


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