Batcher Protocol Splitter
For true unbatching of a firmware super-frame into one Rogue frame per record,
Rogue provides rogue.protocols.batcher.SplitterV1 and SplitterV2.
Use a splitter when downstream logic needs ordinary record-sized frames for filtering, routing, analysis, or file capture.
Version Selection
Use
SplitterV1with batcher v1 framing.Use
SplitterV2with batcher v2 framing.
How Splitting Works
The splitter uses the corresponding parser core to decode one batched frame, then emits one output frame per parsed record:
SplitterV1usesCoreV1.SplitterV2usesCoreV2.
Each parsed Data record becomes one Rogue output frame. The payload bytes
are copied from the parsed record, and the record metadata is mapped into the
output frame fields.
Output Metadata Mapping
Output
channelcomes from the record destination.Output
firstUsercomes from the record first-user metadata.Output
lastUsercomes from the record last-user metadata.
That mapping is why a splitter is useful for downstream stream processing: once the super-frame has been split, the downstream path can operate on each record using the ordinary Rogue stream metadata it already expects.
Splitter vs Inverter
Use a splitter when downstream stages need one frame per record. Use Batcher Protocol Inverter when downstream expects one transformed super-frame instead.
Python Examples
V1
import rogue.protocols.batcher
import rogue.interfaces.stream
# Source produces batcher-v1 super-frames.
src = MyBatcherV1Source()
# Split one input super-frame into one output frame per parsed record.
split = rogue.protocols.batcher.SplitterV1()
# Keep only record destination 1 after unbatching.
filt = rogue.interfaces.stream.Filter(True, 1)
dst = MyRecordSink()
src >> split >> filt >> dst
V2
import rogue.protocols.batcher
import rogue.interfaces.stream
# Source produces batcher-v2 super-frames.
src = MyBatcherV2Source()
# Split one input super-frame into one output frame per parsed record.
split = rogue.protocols.batcher.SplitterV2()
# Keep only record destination 3 after unbatching.
filt = rogue.interfaces.stream.Filter(True, 3)
dst = MyRecordSink()
src >> split >> filt >> dst
C++ Example
#include <rogue/protocols/batcher/SplitterV1.h>
namespace rpb = rogue::protocols::batcher;
int main() {
// Source produces batcher-v1 super-frames.
auto src = MyBatchedFrameSource::create();
// Split one input super-frame into one output frame per parsed record.
auto split = rpb::SplitterV1::create();
auto dst = MyRecordSink::create();
*(*src >> split) >> dst;
return 0;
}
Threading And Lifecycle
The splitter classes do not create worker threads. Splitting runs
synchronously inside acceptFrame() in the caller thread.
API Reference
Python: SplitterV1 SplitterV2
C++: SplitterV1 SplitterV2