|
rogue
|
Stream sink that writes incoming frames into a tagged writer channel. More...
#include <StreamWriterChannel.h>
Public Member Functions | |
| StreamWriterChannel (std::shared_ptr< rogue::utilities::fileio::StreamWriter > writer, uint8_t channel) | |
| Constructs a stream writer channel. | |
| ~StreamWriterChannel () | |
| Destroys stream writer channel. | |
| void | acceptFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame) |
| Accepts and writes one incoming frame. | |
| uint32_t | getFrameCount () |
| Returns the number of accepted frames. | |
| void | setFrameCount (uint32_t count) |
| Sets the accepted-frame counter to a specific value. | |
| bool | waitFrameCount (uint32_t count, uint64_t timeout) |
Waits until at least count frames have been accepted. | |
Public Member Functions inherited from rogue::interfaces::stream::Slave | |
| Slave () | |
| Constructs a stream slave. | |
| virtual | ~Slave () |
| Destroys the stream slave. | |
| virtual void | stop () |
| Shuts down threads associated with this object. | |
| void | setDebug (uint32_t debug, std::string name) |
| Sets debug message verbosity and logger name. | |
| uint64_t | getFrameCount () |
| Returns frame counter. | |
| uint64_t | getByteCount () |
| Returns byte counter. | |
| bool | ensureSingleBuffer (std::shared_ptr< rogue::interfaces::stream::Frame > &frame, bool reqEn) |
| Ensures frame is backed by a single buffer. | |
| std::shared_ptr< rogue::interfaces::stream::Frame > | reqLocalFrame (uint32_t size, bool zeroCopyEn) |
| Services a local frame allocation request through this object's pool interface. | |
| boost::python::object | lshiftPy (boost::python::object p) |
Supports << operator usage from Python. | |
| std::shared_ptr< rogue::interfaces::stream::Master > & | operator<< (std::shared_ptr< rogue::interfaces::stream::Master > &other) |
| Connects this slave to a master via stream chaining operator. | |
Public Member Functions inherited from rogue::interfaces::stream::Pool | |
| Pool () | |
| Constructs a pool with default allocation behavior enabled. | |
| virtual | ~Pool () |
| Destroys the pool and releases any cached buffer storage. | |
| uint32_t | getAllocBytes () |
| Returns total currently allocated bytes. | |
| uint32_t | getAllocCount () |
| Returns total currently allocated buffer count. | |
| virtual std::shared_ptr< rogue::interfaces::stream::Frame > | acceptReq (uint32_t size, bool zeroCopyEn) |
| Services a frame allocation request from a master. | |
| virtual void | retBuffer (uint8_t *data, uint32_t meta, uint32_t size) |
| Returns buffer data to the allocator. | |
| void | setFixedSize (uint32_t size) |
| Sets fixed-size mode. | |
| uint32_t | getFixedSize () |
| Returns fixed-size allocation setting. | |
| void | setPoolSize (uint32_t size) |
| Sets buffer pool size. | |
| uint32_t | getPoolSize () |
| Returns configured maximum number of cached pool entries. | |
Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Pool > | |
| std::shared_ptr< rogue::interfaces::stream::Pool > | shared_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. | |
Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Slave > | |
| std::shared_ptr< rogue::interfaces::stream::Slave > | shared_from_this () |
Returns a shared_ptr<T> for this instance. | |
Static Public Member Functions | |
| static std::shared_ptr< rogue::utilities::fileio::StreamWriterChannel > | create (std::shared_ptr< rogue::utilities::fileio::StreamWriter > writer, uint8_t channel) |
| Creates a stream writer channel instance. | |
| static void | setup_python () |
| Registers Python bindings for this class. | |
Static Public Member Functions inherited from rogue::interfaces::stream::Slave | |
| static std::shared_ptr< rogue::interfaces::stream::Slave > | create () |
| Creates a new stream slave. | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
Static Public Member Functions inherited from rogue::interfaces::stream::Pool | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
Additional Inherited Members | |
Protected Member Functions inherited from rogue::interfaces::stream::Pool | |
| std::shared_ptr< rogue::interfaces::stream::Buffer > | allocBuffer (uint32_t size, uint32_t *total) |
| Allocate a buffer passed size. | |
| std::shared_ptr< rogue::interfaces::stream::Buffer > | createBuffer (void *data, uint32_t meta, uint32_t size, uint32_t alloc) |
| Creates a Buffer with a pre-allocated data block. | |
| void | decCounter (uint32_t alloc) |
| Decrements allocation counter. | |
Stream sink that writes incoming frames into a tagged writer channel.
StreamWriterChannel is a stream::Slave front end for StreamWriter. Each instance is bound to a channel/tag value used in the output file bank header. If constructed with channel == 0, the channel is taken from each incoming frame (frame->getChannel()); otherwise the configured channel is forced for all writes.
The class also tracks how many frames have been accepted so callers can synchronize on data capture progress with waitFrameCount().
Definition at line 49 of file StreamWriterChannel.h.
| rogue::utilities::fileio::StreamWriterChannel::StreamWriterChannel | ( | std::shared_ptr< rogue::utilities::fileio::StreamWriter > | writer, |
| uint8_t | channel | ||
| ) |
Constructs a stream writer channel.
Creator.
This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.
| writer | Destination writer used to serialize frames. |
| channel | Output channel/tag. Use 0 to forward per-frame channel. |
Definition at line 62 of file StreamWriterChannel.cpp.
| rogue::utilities::fileio::StreamWriterChannel::~StreamWriterChannel | ( | ) |
Destroys stream writer channel.
Deconstructor.
Definition at line 69 of file StreamWriterChannel.cpp.
|
virtual |
Accepts and writes one incoming frame.
Accept a frame from master.
The method writes the frame through StreamWriter, increments the local accepted-frame counter, and wakes waiters in waitFrameCount().
| frame | Input frame to write. |
Reimplemented from rogue::interfaces::stream::Slave.
Definition at line 72 of file StreamWriterChannel.cpp.
|
static |
Creates a stream writer channel instance.
Class creation.
Parameter semantics are identical to the constructor; see StreamWriterChannel() for output-channel behavior details. 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.
| writer | Destination writer used to serialize frames. |
| channel | Output channel/tag. Use 0 to forward per-frame channel. |
Description : Class to act as a slave interface to the StreamWriterChannel. Each slave is associated with a tag. The tag is included in the bank header
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
Definition at line 43 of file StreamWriterChannel.cpp.
| uint32_t rogue::utilities::fileio::StreamWriterChannel::getFrameCount | ( | ) |
Returns the number of accepted frames.
Definition at line 91 of file StreamWriterChannel.cpp.
| void rogue::utilities::fileio::StreamWriterChannel::setFrameCount | ( | uint32_t | count | ) |
Sets the accepted-frame counter to a specific value.
| count | New frame counter value. |
Definition at line 95 of file StreamWriterChannel.cpp.
|
static |
Registers Python bindings for this class.
Setup class in python.
Definition at line 49 of file StreamWriterChannel.cpp.
| bool rogue::utilities::fileio::StreamWriterChannel::waitFrameCount | ( | uint32_t | count, |
| uint64_t | timeout | ||
| ) |
Waits until at least count frames have been accepted.
| count | Target accepted-frame count. |
| timeout | Timeout in microseconds. 0 waits indefinitely. |
true if count was reached before timeout, else false. Definition at line 101 of file StreamWriterChannel.cpp.