SplitterV2
For conceptual usage, see:
Implementation
This Python API is provided by a Rogue C++ class exported into Python.
Native C++ class: - SplitterV2
Generated API
- class rogue.protocols.batcher.SplitterV2
C++:
rogue::protocols::batcher::SplitterV2Binding source: [SplitterV2.cpp]
Splits one batcher v2 super-frame into per-record output frames.
Protocol reference: https://confluence.slac.stanford.edu/x/L2VlK
SplitterV2usesCoreV2to parse a batcher super-frame, then emits one Rogue stream frame per parsedDatarecord:Payload bytes copied from record data.
Channel set from record destination.
First/last user fields propagated from record metadata. Threading model:
No internal worker thread is created.
Processing executes synchronously in the caller thread of
acceptFrame().
- __init__()
C++:
rogue::protocols::batcher::SplitterV2Constructs a
SplitterV2instance.This constructor is a low-level C++ allocation path. Prefer
create()when shared ownership or Python exposure is required.
- _addSlave(slave)
C++:
rogue::interfaces::stream::Master::addSlave()Attaches a downstream slave.
Multiple slaves are supported. The first attached slave is used for frame allocation and receives frames last during send. Exposed as
_addSlave()in Python.- Parameters:
slave – Stream slave pointer.
- _slaveCount()
C++:
rogue::interfaces::stream::Master::slaveCount()Returns the number of attached slaves.
Exposed as
_slaveCount()in Python.- Returns:
Number of attached slaves.
- _reqFrame(size, zeroCopyEn)
C++:
rogue::interfaces::stream::Master::reqFrame()Requests allocation of a new frame from the primary slave.
Creates an empty frame with at least the requested payload capacity. The Master will forward this request to the primary Slave object. The request for a new Frame includes a flag which indicates if a zeroCopy frame is allowed. In most cases this flag can be set to
true. Non-zero-copy frames are requested if the Master may need to transmit the same frame multiple times. Exposed as_reqFrame()in Python.- Parameters:
size – Minimum requested payload size in bytes.
zeroCopyEn – Set to
truewhen zero-copy frame allocation is allowed.
- Returns:
Newly allocated frame pointer.
- _sendFrame(frame)
C++:
rogue::interfaces::stream::Master::sendFrame()Sends a frame to all attached slaves.
This method sends the passed Frame to all of the attached Slave objects by calling their acceptFrame() method. First the secondary Slaves are called in order of attachment, followed last by the primary Slave. If the Frame is a zero copy frame it will most likely be empty when the sendFrame() method returns Exposed as
_sendFrame()in Python.- Parameters:
frame – Frame to send.
- _stop()
C++:
rogue::interfaces::stream::Master::stop()Stops frame generation and shuts down associated threads.
Exposed as
stop()in Python. This is the primary subclass hook onMaster. Override when the subclass owns background activity or transport resources that require deterministic shutdown.
- __rshift__(other)
C++:
rogue::interfaces::stream::Master::rshiftPy()Supports
>>operator usage from Python.- Parameters:
p – Python object expected to resolve to a stream
Slave.- Returns:
Original Python object for chaining semantics.
- setDebug(debug, name)
C++:
rogue::interfaces::stream::Slave::setDebug()Sets debug message verbosity and logger name.
This method enables debug messages when using the base Slave class attached as a primary or secondary Slave on a Master. Typically used when attaching a base Slave object for debug purposes. Exposed as
setDebug()in Python.- Parameters:
debug – Maximum number of bytes to print in debug message.
name – Name included in debug messages.
- _acceptFrame(frame)
C++:
rogue::interfaces::stream::Slave::acceptFrame()Accepts a frame from an upstream master.
Invokes the Python override when provided.
- Parameters:
frame – Frame received from the stream path.
- getFrameCount()
C++:
rogue::interfaces::stream::Slave::getFrameCount()Returns frame counter.
Returns the total frames received. Only valid if acceptFrame is not re-implemented as a sub-class. Typically used when attaching a base Slave object for debug purposes. Exposed as
getFrameCount()in Python.- Returns:
Total number of Frame objects received.
- getByteCount()
C++:
rogue::interfaces::stream::Slave::getByteCount()Returns byte counter.
Returns the total bytes received. Only valid if acceptFrame is not re-implemented as a sub-class. Typically used when attaching a base Slave object for debug purposes. Exposed as
getByteCount()in Python.- Returns:
Total number of bytes received.
- _stop()
C++:
rogue::interfaces::stream::Slave::stop()Shuts down threads associated with this object.
Called during shutdown to stop activity and allow clean process exit. Subclasses should override when they own worker threads or timers. Exposed as
stop()in Python.
- getAllocCount()
C++:
rogue::interfaces::stream::Pool::getAllocCount()Returns total currently allocated buffer count.
This value is incremented as buffers are allocated and decremented as buffers are freed. Exposed as
getAllocCount()in Python.- Returns:
Total currently allocated buffers.
- getAllocBytes()
C++:
rogue::interfaces::stream::Pool::getAllocBytes()Returns total currently allocated bytes.
This value is incremented as buffers are allocated and decremented as buffers are freed. Exposed as
getAllocBytes()in Python.- Returns:
Total currently allocated bytes.
- setFixedSize(size)
C++:
rogue::interfaces::stream::Pool::setFixedSize()Sets fixed-size mode.
This method puts the allocator into fixed size mode. Exposed as
setFixedSize()in Python.- Parameters:
size – Fixed size value.
- getFixedSize()
C++:
rogue::interfaces::stream::Pool::getFixedSize()Returns fixed-size allocation setting.
A return value of
0means fixed-size mode is disabled. Exposed asgetFixedSize()in Python.- Returns:
Fixed size value or
0when fixed-size mode is disabled.
- setPoolSize(size)
C++:
rogue::interfaces::stream::Pool::setPoolSize()Sets buffer pool size. Exposed as
setPoolSize()in Python.- Parameters:
size – Number of entries to keep in the pool.
- getPoolSize()
C++:
rogue::interfaces::stream::Pool::getPoolSize()Returns configured maximum number of cached pool entries. Exposed as
getPoolSize()in Python.- Returns:
Pool size.
- __lshift__(other)
C++:
rogue::interfaces::stream::Slave::lshiftPy()Supports
<<operator usage from Python.- Parameters:
p – Python object expected to resolve to a stream
Master.- Returns:
Original Python object for chaining semantics.