StreamWriterChannel

The StreamWriterChannel class is the interface between the StreamWriter class and the incoming data streams.

StreamWriterChannel objects in C++ are referenced by the following shared pointer typedef:

typedef std::shared_ptr<rogue::utilities::fileio::StreamWriterChannel> rogue::utilities::fileio::StreamWriterChannelPtr

The class description is shown below:

class StreamWriterChannel : public rogue::interfaces::stream::Slave

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().

Public Functions

StreamWriterChannel(std::shared_ptr<rogue::utilities::fileio::StreamWriter> writer, uint8_t channel)

Constructs a stream writer channel.

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

Parameters:
  • writer – Destination writer used to serialize frames.

  • channel – Output channel/tag. Use 0 to forward per-frame channel.

~StreamWriterChannel()

Destroys stream writer channel.

virtual void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame)

Accepts and writes one incoming frame.

The method writes the frame through StreamWriter, increments the local accepted-frame counter, and wakes waiters in waitFrameCount().

Parameters:

frame – Input frame to write.

uint32_t getFrameCount()

Returns the number of accepted frames.

Returns:

Accepted frame count.

void setFrameCount(uint32_t count)

Sets the accepted-frame counter to a specific value.

Parameters:

count – New frame counter value.

bool waitFrameCount(uint32_t count, uint64_t timeout)

Waits until at least count frames have been accepted.

Parameters:
  • count – Target accepted-frame count.

  • timeout – Timeout in microseconds. 0 waits indefinitely.

Returns:

true if count was reached before timeout, else false.

Public Static 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.

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.

Parameters:
  • writer – Destination writer used to serialize frames.

  • channel – Output channel/tag. Use 0 to forward per-frame channel.

Returns:

Shared pointer to the created channel.

static void setup_python()

Registers Python bindings for this class.