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

NamesIter subclass that, besides Names, keeps pointers to ShapesData xtcs keyed by the low 8 bits (NamesId::namesId()) of their NamesId. More...

#include <ConfigIter.hh>

Inherits XtcData::NamesIter.

Public Types

enum  CTOR_TYPE { CTOR_DEFAULT , CTOR_REGULAR }
 Records which constructor built the object. More...
 
- Public Types inherited from XtcData::NamesIter
enum  { Stop , Continue }
 Return values of process(). More...
 

Public Member Functions

 ConfigIter (XtcData::Xtc *xtc, const void *bufEnd)
 Construct rooted at xtc and immediately call iterate(); bufEnd bounds the buffer (may be null).
 
 ConfigIter ()
 Default constructor; nothing is iterated and constructor_type() returns CTOR_DEFAULT.
 
 ~ConfigIter ()
 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, store a NameIndex for each TypeId::Names xtc in namesLookup() (a duplicate NamesId overwrites, no error), and store each TypeId::ShapesData pointer under NamesId::namesId().
 
ShapesData & shape ()
 Return the ShapesData stored under namesId 0.
 
ShapesData & value ()
 Return the ShapesData stored under namesId 1.
 
ShapesData & getShape (unsigned idx)
 Return the ShapesData stored under namesId idx.
 
DescData & desc_shape ()
 Delete any previous result, then build and return a new DescData from shape() and the NameIndex that namesLookup() holds for its NamesId.
 
DescData & desc_value ()
 Print a debug line ("YYY ==> ConfigIter::desc_value") to stdout, delete any previous result, then build and return a new DescData from value() and its NameIndex in namesLookup().
 
 ConfigIter (const ConfigIter &)=delete
 Copy construction is disabled.
 
ConfigIter & operator= (const ConfigIter &)=delete
 Copy assignment is disabled.
 
bool default_constructor () const
 Return true if the object was built by ConfigIter().
 
bool regular_constructor () const
 Return true if the object was built by ConfigIter(Xtc*, const void*).
 
CTOR_TYPE constructor_type () const
 Return the CTOR_TYPE recorded by the constructor.
 
- Public Member Functions inherited from XtcData::NamesIter
 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*).
 
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

NamesIter subclass that, besides Names, keeps pointers to ShapesData xtcs keyed by the low 8 bits (NamesId::namesId()) of their NamesId.

The header comment says it gives access to configuration info from the first datagram of an xtc2 file.

Member Enumeration Documentation

◆ CTOR_TYPE

Records which constructor built the object.

Enumerator
CTOR_DEFAULT 

Set by ConfigIter().

CTOR_REGULAR 

Set by ConfigIter(Xtc*, const void*).

Constructor & Destructor Documentation

◆ ConfigIter() [1/3]

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

Construct rooted at xtc and immediately call iterate(); bufEnd bounds the buffer (may be null).

◆ ConfigIter() [2/3]

XtcData::ConfigIter::ConfigIter ( )
inline

Default constructor; nothing is iterated and constructor_type() returns CTOR_DEFAULT.

◆ ~ConfigIter()

XtcData::ConfigIter::~ConfigIter ( )

Delete the DescData objects created by desc_shape() and desc_value().

◆ ConfigIter() [3/3]

XtcData::ConfigIter::ConfigIter ( const ConfigIter &  )
delete

Copy construction is disabled.

Member Function Documentation

◆ constructor_type()

CTOR_TYPE XtcData::ConfigIter::constructor_type ( ) const
inline

Return the CTOR_TYPE recorded by the constructor.

◆ default_constructor()

bool XtcData::ConfigIter::default_constructor ( ) const
inline

Return true if the object was built by ConfigIter().

◆ desc_shape()

DescData & XtcData::ConfigIter::desc_shape ( )

Delete any previous result, then build and return a new DescData from shape() and the NameIndex that namesLookup() holds for its NamesId.

The object is owned by this ConfigIter and freed by the next call or the destructor.

◆ desc_value()

DescData & XtcData::ConfigIter::desc_value ( )

Print a debug line ("YYY ==> ConfigIter::desc_value") to stdout, delete any previous result, then build and return a new DescData from value() and its NameIndex in namesLookup().

The object is owned by this ConfigIter and freed by the next call or the destructor.

◆ getShape()

ShapesData & XtcData::ConfigIter::getShape ( unsigned  idx)
inline

Return the ShapesData stored under namesId idx.

No check is made: a missing entry yields a null pointer that is dereferenced.

◆ operator=()

ConfigIter & XtcData::ConfigIter::operator= ( const ConfigIter &  )
delete

Copy assignment is disabled.

◆ process()

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

Iterate into TypeId::Parent xtcs, store a NameIndex for each TypeId::Names xtc in namesLookup() (a duplicate NamesId overwrites, no error), and store each TypeId::ShapesData pointer under NamesId::namesId().

Returns
Always Continue.

Reimplemented from XtcData::NamesIter.

◆ regular_constructor()

bool XtcData::ConfigIter::regular_constructor ( ) const
inline

Return true if the object was built by ConfigIter(Xtc*, const void*).

◆ shape()

ShapesData & XtcData::ConfigIter::shape ( )
inline

Return the ShapesData stored under namesId 0.

No check is made: a missing entry yields a null pointer that is dereferenced.

◆ value()

ShapesData & XtcData::ConfigIter::value ( )
inline

Return the ShapesData stored under namesId 1.

No check is made: a missing entry yields a null pointer that is dereferenced.


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