|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Reader for a ShapesData: combines it with the NameIndex of its Names to compute the byte offset of each field in the Data payload. More...
#include <DescData.hh>
Inherited by XtcData::CreateData, and XtcData::DescribedData.
Public Member Functions | |
| DescData (ShapesData &shapesdata, NameIndex &nameindex) | |
| Compute the field offsets for reading an existing shapesdata. | |
| DescData & | operator= (const DescData &o) |
| Copy offsets and counts from o. | |
| ~DescData () | |
| Destructor; does nothing. | |
| template<typename T > | |
| Array< T > | get_array (unsigned index) |
| Return an Array<T> view of field index: data at the field's offset in the Data payload, shape from shape(name), rank from the Name. | |
| template<class T > | |
| T | get_value (const char *name) |
| Look up name in the NameIndex's nameMap and return get_value<T>(index). | |
| template<class T > | |
| T | get_value (unsigned index) |
| Return a copy of the T stored at field index's offset in the Data payload. | |
| template<class T > | |
| T & | get_lvalue (unsigned index) |
| Return a reference to the T at field index's offset in the Data payload. | |
| uint32_t * | shape (Name &name) |
| Return the dimension array of the Shape at index shapeMap()[name.name()] in the Shapes child. | |
| NameIndex & | nameindex () |
| Return the NameIndex reference. | |
| ShapesData & | shapesdata () |
| Return the ShapesData reference. | |
| void | shapesdata (ShapesData &o) |
| Assign o into the referenced ShapesData (Xtc::operator=, which copies src, damage and contains and resets extent to sizeof(Xtc)); the reference is not rebound. | |
Static Public Member Functions | |
| static void | incorrectType (const char *file, unsigned line, Name &name) |
| Print file, line, and the type and name of name, then call abort(). | |
| static void | checkType (uint8_t val, Name &name) |
| Abort (incorrectType()) unless name.type() is UINT8; val only selects the overload. | |
| static void | checkType (uint16_t val, Name &name) |
| Abort (incorrectType()) unless name.type() is UINT16; val only selects the overload. | |
| static void | checkType (uint32_t val, Name &name) |
| Abort (incorrectType()) unless name.type() is UINT32, ENUMVAL or ENUMDICT; val only selects the overload. | |
| static void | checkType (uint64_t val, Name &name) |
| Abort (incorrectType()) unless name.type() is UINT64; val only selects the overload. | |
| static void | checkType (int8_t val, Name &name) |
| Abort (incorrectType()) unless name.type() is INT8; val only selects the overload. | |
| static void | checkType (int16_t val, Name &name) |
| Abort (incorrectType()) unless name.type() is INT16; val only selects the overload. | |
| static void | checkType (int32_t val, Name &name) |
| Abort (incorrectType()) unless name.type() is INT32, ENUMVAL or ENUMDICT; val only selects the overload. | |
| static void | checkType (int64_t val, Name &name) |
| Abort (incorrectType()) unless name.type() is INT64; val only selects the overload. | |
| static void | checkType (float val, Name &name) |
| Abort (incorrectType()) unless name.type() is FLOAT; val only selects the overload. | |
| static void | checkType (double val, Name &name) |
| Abort (incorrectType()) unless name.type() is DOUBLE; val only selects the overload. | |
| static void | checkType (char val, Name &name) |
| Abort (incorrectType()) unless name.type() is CHARSTR; val only selects the overload. | |
Protected Member Functions | |
| DescData (NameIndex &nameindex, Xtc &parent, const void *bufEnd, NamesId &namesId) | |
| DescData (NameIndex &nameindex, Xtc &parent, const void *bufEnd, VarDef &V, NamesId &namesId) | |
| void | set_array_shape (unsigned index, unsigned shapeIndex, const unsigned shape[MaxRank]) |
Protected Attributes | |
| std::vector< unsigned > | _offset |
| ShapesData & | _shapesdata |
| unsigned | _numentries |
| NameIndex & | _nameindex |
| unsigned | _numarrays |
Reader for a ShapesData: combines it with the NameIndex of its Names to compute the byte offset of each field in the Data payload.
Field offsets are cumulative: a scalar takes Name::get_element_size() bytes and an array takes Shape::size() of the next Shape entry.
|
inline |
Compute the field offsets for reading an existing shapesdata.
Array fields use the Shapes entries in order (0, 1, ...). Throws (from NameIndex::names()) if nameindex holds no Names.
|
inline |
Destructor; does nothing.
|
inlineprotected |
|
inlineprotected |
Abort (incorrectType()) unless name.type() is CHARSTR; val only selects the overload.
Abort (incorrectType()) unless name.type() is DOUBLE; val only selects the overload.
Abort (incorrectType()) unless name.type() is FLOAT; val only selects the overload.
Abort (incorrectType()) unless name.type() is INT16; val only selects the overload.
Abort (incorrectType()) unless name.type() is INT32, ENUMVAL or ENUMDICT; val only selects the overload.
Abort (incorrectType()) unless name.type() is INT64; val only selects the overload.
Abort (incorrectType()) unless name.type() is INT8; val only selects the overload.
Abort (incorrectType()) unless name.type() is UINT16; val only selects the overload.
Abort (incorrectType()) unless name.type() is UINT32, ENUMVAL or ENUMDICT; val only selects the overload.
Abort (incorrectType()) unless name.type() is UINT64; val only selects the overload.
Abort (incorrectType()) unless name.type() is UINT8; val only selects the overload.
Return a reference to the T at field index's offset in the Data payload.
Aborts with a message if index > the number of entries; the type is not checked.
Look up name in the NameIndex's nameMap and return get_value<T>(index).
Prints a message and aborts if the name is not found.
Return a copy of the T stored at field index's offset in the Data payload.
Aborts with a message if index > the number of entries (index equal to it is not rejected), or via checkType() if T does not match the field's DataType.
|
inlinestatic |
Print file, line, and the type and name of name, then call abort().
Copy offsets and counts from o.
The ShapesData and NameIndex members are references, so o's objects are assigned into the referenced ones (Xtc::operator= resets that ShapesData's extent to sizeof(Xtc)) instead of rebinding.
|
inlineprotected |
|
inline |
Return the ShapesData reference.
|
inline |
Assign o into the referenced ShapesData (Xtc::operator=, which copies src, damage and contains and resets extent to sizeof(Xtc)); the reference is not rebound.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |