|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
16-bit word: bits 11:0 hold the Type, bits 15:12 the version. More...
#include <TypeId.hh>
Public Types | |
| enum | Type { Parent , ShapesData , Shapes , Data , Names , NumberOf } |
| Payload types. More... | |
Public Member Functions | |
| TypeId () | |
| Default constructor; the value is left uninitialized. | |
| TypeId (const TypeId &v) | |
| Copy the 16-bit value of v. | |
| TypeId (Type type, unsigned version) | |
| Set the value to ((version << 12) & 0xf000) | type, so only the low 4 bits of version are kept. | |
| TypeId (const char *) | |
Parse a string of the form NAME_vDIGITS, where NAME is one of name()'s strings and DIGITS is the version number. | |
| Type | id () const |
| Return bits 11:0 as a Type. | |
| unsigned | version () const |
| Return bits 15:12. | |
| unsigned | value () const |
| Return the full 16-bit value. | |
Static Public Member Functions | |
| static const char * | name (Type type) |
| Return "Parent", "ShapesData", "Shapes", "Data" or "Names" for type, or "-Invalid-" if type >= NumberOf. | |
16-bit word: bits 11:0 hold the Type, bits 15:12 the version.
Payload types.
Per the comment above, values are already recorded in xtc files, so new ones must be appended.
| Enumerator | |
|---|---|
| Parent | Value 0. NamesIter, ConfigIter and DataIter iterate into xtcs of this type. |
| ShapesData | Value 1. Set by the ShapesData constructor. |
| Shapes | Value 2. Set by the Shapes constructor. |
| Data | Value 3. Set by the Data constructor. |
| Names | Value 4. Set by the Names constructor; NamesIter reads xtcs of this type as Names. |
| NumberOf | Value 5, the number of types; name() returns "-Invalid-" for values at or above it. |
|
inline |
Default constructor; the value is left uninitialized.
Set the value to ((version << 12) & 0xf000) | type, so only the low 4 bits of version are kept.
Parse a string of the form NAME_vDIGITS, where NAME is one of name()'s strings and DIGITS is the version number.
On a match the code computes (version << 16) | type, which the 16-bit storage truncates to just the type, so the parsed version is dropped (version() returns 0). If there is no "_v" suffix, the digits are missing or followed by other characters, or the name is unknown, the value is NumberOf.
|
inline |
Return bits 11:0 as a Type.
Return "Parent", "ShapesData", "Shapes", "Data" or "Names" for type, or "-Invalid-" if type >= NumberOf.
|
inline |
Return the full 16-bit value.
|
inline |
Return bits 15:12.