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

Src whose value holds a node id in bits 19:8 and a names id in bits 7:0 (level Segment). More...

#include <NamesId.hh>

Inherits XtcData::Src.

Public Types

enum  { NumberOf =1<<20 }
 Size of the NamesId value space. More...
 

Public Member Functions

 NamesId ()
 Default constructor: Src() gives value 0, level Segment (the source comment calls it an undefined Src).
 
 NamesId (unsigned nodeId, unsigned namesId)
 Store ((nodeId & 0xfff) << 8) | (namesId & 0xff) as the Src value, level Segment.
 
 operator unsigned () const
 Return value(), the packed node id and names id.
 
unsigned nodeId ()
 Return bits 19:8.
 
unsigned namesId ()
 Return bits 7:0.
 
- Public Member Functions inherited from XtcData::Src
 Src (Level::Type level=Level::Segment)
 Set the level bits to level and the value bits to 0.
 
 Src (unsigned value, Level::Type level=Level::Segment)
 Store value & 0x0fffffff in bits 27:0 and level in bits 31:28.
 
Level::Type level () const
 Return bits 31:28 as a Level::Type.
 
unsigned value () const
 Return bits 27:0.
 

Additional Inherited Members

- Protected Attributes inherited from XtcData::Src
uint32_t _value
 

Detailed Description

Src whose value holds a node id in bits 19:8 and a names id in bits 7:0 (level Segment).

Per the comment above, Names and ShapesData store it in their Src so a ShapesData can be matched to its Names.

Member Enumeration Documentation

◆ anonymous enum

Size of the NamesId value space.

The comment above says it must match the bits used and sets the size of the Names lookup.

Enumerator
NumberOf 

1<<20, the number of distinct 12-bit node id + 8-bit names id values.

Constructor & Destructor Documentation

◆ NamesId() [1/2]

XtcData::NamesId::NamesId ( )
inline

Default constructor: Src() gives value 0, level Segment (the source comment calls it an undefined Src).

◆ NamesId() [2/2]

XtcData::NamesId::NamesId ( unsigned  nodeId,
unsigned  namesId 
)
inline

Store ((nodeId & 0xfff) << 8) | (namesId & 0xff) as the Src value, level Segment.

Prints a message and calls abort() if nodeId does not fit in 12 bits or namesId in 8 bits.

Member Function Documentation

◆ namesId()

unsigned XtcData::NamesId::namesId ( )
inline

Return bits 7:0.

◆ nodeId()

unsigned XtcData::NamesId::nodeId ( )
inline

Return bits 19:8.

◆ operator unsigned()

XtcData::NamesId::operator unsigned ( ) const
inline

Return value(), the packed node id and names id.


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