CoreV2
CoreV2 parses Batcher v2 super-frames and exposes parsed record metadata
through Data objects plus header/tail iterators.
Protocol reference: https://confluence.slac.stanford.edu/x/L2VlK
CoreV2 objects in C++ are referenced by the following shared pointer typedef:
The class description is shown below:
-
class CoreV2
Parser for SLAC AXI Batcher v2 super-frames.
Protocol reference: https://confluence.slac.stanford.edu/x/L2VlK
CoreV2parses one incoming batched stream frame into:A fixed-size super-header region.
A list of per-record
Datadescriptors.A list of tail iterators for each record.
This class is the shared parser used by
SplitterV2andInverterV2.SplitterV2uses parsedDatarecords to emit one frame per batch entry.InverterV2uses parsed tail/header locations to rewrite framing in place.
Record accessors (
record(),beginTail(),endTail()) expose records in stream order, even though parsing walks tails from the end of the frame.Threading model:
No internal threads are created.
The object is intended for single-threaded use per instance.
Public Functions
-
CoreV2()
Constructs a
CoreV2parser.This constructor is a low-level C++ allocation path. Prefer
create()when shared ownership or Python exposure is required.
-
~CoreV2()
Destroys the parser.
-
void initSize(uint32_t size)
Pre-reserves internal record/tail container capacity.
- Parameters:
size – Expected maximum record count per frame.
-
uint32_t count()
Returns number of parsed records.
- Returns:
Parsed record count.
-
uint32_t headerSize()
Returns parsed super-header size.
- Returns:
Header size in bytes.
-
rogue::interfaces::stream::FrameIterator beginHeader()
Returns iterator to beginning of parsed header.
- Returns:
Header-begin iterator.
-
rogue::interfaces::stream::FrameIterator endHeader()
Returns iterator to end of parsed header.
- Returns:
Header-end iterator.
-
uint32_t tailSize()
Returns parsed tail size per record.
- Returns:
Tail size in bytes.
-
rogue::interfaces::stream::FrameIterator beginTail(uint32_t index)
Returns iterator to beginning of a parsed record tail.
- Parameters:
index – Zero-based record index in stream order.
- Returns:
Tail-begin iterator for requested record.
-
rogue::interfaces::stream::FrameIterator endTail(uint32_t index)
Returns iterator to end of a parsed record tail.
- Parameters:
index – Zero-based record index in stream order.
- Returns:
Tail-end iterator for requested record.
-
std::shared_ptr<rogue::protocols::batcher::Data> &record(uint32_t index)
Returns parsed data record descriptor by index.
- Parameters:
index – Zero-based record index in stream order.
- Returns:
Reference to parsed
Datarecord pointer.
-
uint32_t sequence()
Returns parsed batch sequence number.
- Returns:
Sequence number from super-header.
Parses a batched frame and populates parser state.
On success, header/tail metadata and record descriptors are available through the accessor methods. On failure, parser state is reset and
falseis returned.- Parameters:
frame – Input batched frame.
- Returns:
trueif frame is valid and parsed; otherwisefalse.
-
void reset()
Clears parsed frame state and record lists.
Public Static Functions
-
static void setup_python()
Registers Python bindings for this class.
-
static std::shared_ptr<rogue::protocols::batcher::CoreV2> create()
Creates a
CoreV2parser instance.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_ptrownership compatible with Rogue pointer typedefs.- Returns:
Shared pointer to the created parser.