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

Decodes the events of an HPS BLD packet into one HpsEvent, which can hold up to 31 channel values after it. More...

#include <HpsEventIterator.hh>

Public Member Functions

 HpsEventIterator (const char *b, size_t sz)
 Decode the first event of the sz-byte packet at b and check that sz equals the first event's size plus a whole number of later events (see valid()).
 
bool valid () const
 Return the result of the packet size check made by the constructor.
 
bool next ()
 Decode the next event into the current HpsEvent, adding its pulse ID and time stamp offsets to the first event's values.
 
const HpsEvent & operator* ()
 Return the current decoded event.
 
unsigned id () const
 Return the ID, which is initialized to 0 and never set.
 
unsigned nchannels () const
 Return the number of channels, the number of bits set in the first event's channel mask.
 
size_t eventSize () const
 Return the size of an HpsEvent plus its channel values, in bytes.
 

Detailed Description

Decodes the events of an HPS BLD packet into one HpsEvent, which can hold up to 31 channel values after it.

The first event is decoded by the constructor; next() decodes each later one.

Constructor & Destructor Documentation

◆ HpsEventIterator()

Bld::HpsEventIterator::HpsEventIterator ( const char *  b,
size_t  sz 
)
inline

Decode the first event of the sz-byte packet at b and check that sz equals the first event's size plus a whole number of later events (see valid()).

Member Function Documentation

◆ eventSize()

size_t Bld::HpsEventIterator::eventSize ( ) const
inline

Return the size of an HpsEvent plus its channel values, in bytes.

◆ id()

unsigned Bld::HpsEventIterator::id ( ) const
inline

Return the ID, which is initialized to 0 and never set.

◆ nchannels()

unsigned Bld::HpsEventIterator::nchannels ( ) const
inline

Return the number of channels, the number of bits set in the first event's channel mask.

◆ next()

bool Bld::HpsEventIterator::next ( )

Decode the next event into the current HpsEvent, adding its pulse ID and time stamp offsets to the first event's values.

Returns false at the end of the packet.

◆ operator*()

const HpsEvent & Bld::HpsEventIterator::operator* ( )
inline

Return the current decoded event.

◆ valid()

bool Bld::HpsEventIterator::valid ( ) const
inline

Return the result of the packet size check made by the constructor.


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