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.
StreamWriterChannelis astream::Slavefront end forStreamWriter. Each instance is bound to a channel/tag value used in the output file bank header. If constructed withchannel == 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
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
0to forward per-frame channel.
-
~StreamWriterChannel()
Destroys stream writer channel.
Accepts and writes one incoming frame.
The method writes the frame through
StreamWriter, increments the local accepted-frame counter, and wakes waiters inwaitFrameCount().- 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
countframes have been accepted.- Parameters:
count – Target accepted-frame count.
timeout – Timeout in microseconds.
0waits indefinitely.
- Returns:
trueifcountwas reached before timeout, elsefalse.
Public Static Functions
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 returnsstd::shared_ptrownership compatible with Rogue pointer typedefs.- Parameters:
writer – Destination writer used to serialize frames.
channel – Output channel/tag. Use
0to forward per-frame channel.
- Returns:
Shared pointer to the created channel.
-
static void setup_python()
Registers Python bindings for this class.