lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
XtcData::NamesIter Class Reference

XtcIterator subclass that records each Names xtc it visits into a NamesLookup, descending into Parent xtcs. More...

#include <NamesIter.hh>

Inherits XtcData::XtcIterator.

Inherited by XtcData::ConfigIter.

Public Types

enum  { Stop , Continue }
 Return values of process(). More...
 

Public Member Functions

 NamesIter (XtcData::Xtc *xtc, const void *bufEnd)
 Construct an iterator rooted at xtc; bufEnd is passed to XtcIterator as the end-of-buffer bound (may be null).
 
 NamesIter ()
 Default constructor; the XtcIterator root is not set, so use iterate(Xtc*, const void*).
 
virtual int process (XtcData::Xtc *xtc, const void *bufEnd)
 Handle one child xtc: iterate into TypeId::Parent xtcs and store a NameIndex built from each TypeId::Names xtc under its NamesId; ignore other types.
 
NamesLookup & namesLookup ()
 Return a reference to the NamesLookup filled by process().
 
- 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.
 

Detailed Description

XtcIterator subclass that records each Names xtc it visits into a NamesLookup, descending into Parent xtcs.

Member Enumeration Documentation

◆ anonymous enum

Return values of process().

XtcIterator::iterate() stops when process() returns 0 (Stop).

Enumerator
Stop 

Value 0: stop iterating.

Continue 

Value 1: keep iterating.

Constructor & Destructor Documentation

◆ NamesIter() [1/2]

XtcData::NamesIter::NamesIter ( XtcData::Xtc *  xtc,
const void *  bufEnd 
)
inline

Construct an iterator rooted at xtc; bufEnd is passed to XtcIterator as the end-of-buffer bound (may be null).

◆ NamesIter() [2/2]

XtcData::NamesIter::NamesIter ( )
inline

Default constructor; the XtcIterator root is not set, so use iterate(Xtc*, const void*).

Member Function Documentation

◆ namesLookup()

NamesLookup & XtcData::NamesIter::namesLookup ( )
inline

Return a reference to the NamesLookup filled by process().

◆ process()

virtual int XtcData::NamesIter::process ( XtcData::Xtc *  xtc,
const void *  bufEnd 
)
virtual

Handle one child xtc: iterate into TypeId::Parent xtcs and store a NameIndex built from each TypeId::Names xtc under its NamesId; ignore other types.

If a NamesId is already present it prints a message and throws a const char* exception.

Returns
Always Continue.

Implements XtcData::XtcIterator.

Reimplemented in XtcData::ConfigIter.


The documentation for this class was generated from the following file: