|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
XtcIterator subclass that stores pointers to ShapesData xtcs in a 2-entry array indexed by NamesId::namesId() (low 8 bits of the NamesId). More...
#include <DataIter.hh>
Inherits XtcData::XtcIterator.
Public Types | |
| enum | { Stop , Continue } |
| Return values of process(). More... | |
Public Member Functions | |
| DataIter (XtcData::Xtc *xtc, const void *bufEnd) | |
| Construct rooted at xtc and immediately call iterate(); bufEnd bounds the buffer (may be null). | |
| DataIter () | |
| Default constructor; nothing is iterated and the ShapesData array is left uninitialized. | |
| ~DataIter () | |
| Delete the DescData objects created by desc_shape() and desc_value(). | |
| virtual int | process (XtcData::Xtc *xtc, const void *bufEnd) |
| Iterate into TypeId::Parent xtcs and store each TypeId::ShapesData pointer at index NamesId::namesId(); other types (including Names) are ignored. | |
| ShapesData & | shape () |
| Return the ShapesData stored at index 0 (not checked to have been set). | |
| ShapesData & | value () |
| Return the ShapesData stored at index 1 (not checked to have been set). | |
| DescData & | desc_shape (NamesLookup &names_map) |
| On the first call build a DescData from shape() and names_map[shape().namesId()]; later calls return the same cached object and ignore names_map. | |
| DescData & | desc_value (NamesLookup &names_map) |
| On the first call build a DescData from value() and names_map[value().namesId()]; later calls return the same cached object and ignore names_map. | |
| DataIter (const DataIter &)=delete | |
| Copy construction is disabled. | |
| DataIter & | operator= (const DataIter &)=delete |
| Copy assignment is disabled. | |
Public Member Functions inherited from XtcData::XtcIterator | |
| XtcIterator (Xtc *root, const void *bufEnd) | |
| Store root and bufEnd for use by iterate(). | |
| XtcIterator () | |
| Default constructor; root and bufEnd are left uninitialized (use iterate(Xtc*, const void*)). | |
| virtual | ~XtcIterator () |
| Virtual destructor; does nothing. | |
| void | iterate () |
| Call iterate(root, bufEnd) with the values given to the constructor. | |
| void | iterate (Xtc *, const void *bufEnd) |
| Call process() on each child xtc in root's payload, in order, until process() returns 0 or the payload is used up. | |
| const Xtc * | root () const |
| Return the root xtc given to the constructor. | |
XtcIterator subclass that stores pointers to ShapesData xtcs in a 2-entry array indexed by NamesId::namesId() (low 8 bits of the NamesId).
The header comment says it gives access to data in datagrams of an xtc2 file.
Return values of process().
XtcIterator::iterate() stops when process() returns 0 (Stop).
| Enumerator | |
|---|---|
| Stop | Value 0: stop iterating. |
| Continue | Value 1: keep iterating. |
|
inline |
Construct rooted at xtc and immediately call iterate(); bufEnd bounds the buffer (may be null).
|
inline |
Default constructor; nothing is iterated and the ShapesData array is left uninitialized.
| XtcData::DataIter::~DataIter | ( | ) |
Delete the DescData objects created by desc_shape() and desc_value().
| DescData & XtcData::DataIter::desc_shape | ( | NamesLookup & | names_map | ) |
| DescData & XtcData::DataIter::desc_value | ( | NamesLookup & | names_map | ) |
|
virtual |
Iterate into TypeId::Parent xtcs and store each TypeId::ShapesData pointer at index NamesId::namesId(); other types (including Names) are ignored.
There is no bounds check, so a namesId of 2 or more writes past the 2-entry array.
Implements XtcData::XtcIterator.
|
inline |
Return the ShapesData stored at index 0 (not checked to have been set).
|
inline |
Return the ShapesData stored at index 1 (not checked to have been set).