![]() |
ATLAS Offline Software
|
Converts between CHAI payload containers and CORAL objects: a specification plus per-channel rows, both directions. More...
#include <ChaiCoralConverter.h>
Static Public Member Functions | |
| static coral::AttributeListSpecification * | toCoralSpec (const chai::FieldSpec &fields) |
| Build a coral::AttributeListSpecification from a CHAI FieldSpec, one attribute per field in field order. | |
| static chai::FieldSpec | toFieldSpec (const coral::AttributeListSpecification &spec) |
| Build a chai::FieldSpec from a coral::AttributeListSpecification, one field per attribute in spec order. | |
| static coral::AttributeList | toAttributeList (const coral::AttributeListSpecification &spec, const chai::Values &values) |
| Convert one channel's CHAI Values to a coral::AttributeList, one attribute per field in spec order. | |
| static std::vector< coral::AttributeList > | toAttributeListVec (const coral::AttributeListSpecification &spec, const std::vector< chai::ValuesPtr > &rows) |
| Convert one channel's CHAI vector-payload rows to a coral::AttributeList per row, in row order, via toAttributeList(). | |
| static chai::ValuesPtr | toValues (chai::FieldSpecPtr fields, const coral::AttributeList &attrList) |
| Convert one coral::AttributeList to CHAI Values, one value per field in FieldSpec order. | |
| static std::vector< chai::ValuesPtr > | toValuesVec (chai::FieldSpecPtr fields, const std::vector< coral::AttributeList > &rows) |
| Convert a coral::AttributeList per row, in row order, to CHAI Values sharing one FieldSpecPtr, via toValues(). | |
| static std::unique_ptr< AthenaAttributeList > | toAthenaAttributeList (const chai::Container &container) |
| Convert a chai::Container's single populated channel to an AthenaAttributeList. | |
| static chai::Container | toContainer (const AthenaAttributeList &attrList, uint64_t channelId=0, const std::string &channelName="") |
| Convert an AthenaAttributeList to a single-channel chai::Container. | |
| static std::unique_ptr< CondAttrListCollection > | toCondAttrListCollection (const chai::Container &container, bool hasRunLumiBlockTime) |
| Convert a chai::Container to a CondAttrListCollection, one row per populated channel. | |
| static chai::Container | toContainer (const CondAttrListCollection &collection) |
| Convert a CondAttrListCollection to a chai::Container, one channel per entry with an attribute list. | |
| static unsigned int | valuesSize (const chai::Values &values) |
| Total byte size of one channel's field values, using the same type mapping as toAttributeList(). | |
| static unsigned int | payloadSize (const chai::Container &container) |
| Total byte size of every populated channel in a scalar payload. | |
| static unsigned int | payloadSize (const chai::VectorContainer &container) |
| Total byte size of every row of every populated channel in a vector payload. | |
Converts between CHAI payload containers and CORAL objects: a specification plus per-channel rows, both directions.
IOV is never read or written, the caller owns that. Container-level conversions only see populated channels (a Values with at least one value pushed). Zero-attribute CORAL specifications are rejected.
Definition at line 44 of file ChaiCoralConverter.h.
|
static |
Total byte size of every populated channel in a scalar payload.
Definition at line 402 of file ChaiCoralConverter.cxx.
|
static |
Total byte size of every row of every populated channel in a vector payload.
| std::invalid_argument | if a row is null, naming its channel and index. |
Definition at line 410 of file ChaiCoralConverter.cxx.
|
static |
Convert a chai::Container's single populated channel to an AthenaAttributeList.
| container | - the container to convert, with only one populated channel |
| std::runtime_error | if the container does not have exactly one populated channel, or under the same conditions as toCoralSpec() or toAttributeList() for that channel's row. |
Definition at line 303 of file ChaiCoralConverter.cxx.
|
static |
Convert one channel's CHAI Values to a coral::AttributeList, one attribute per field in spec order.
Null fields map to a null coral::Attribute. Fields are resolved by name, so a payload whose fields are ordered differently than the specification still maps correctly.
| spec | - the CORAL specification the values are converted against |
| values | - the CHAI row to convert |
| std::runtime_error | if the field counts of spec and values differ, if a field name in the specification is not present in values, or on an unrecognised chai::Type. |
Definition at line 116 of file ChaiCoralConverter.cxx.
|
static |
Convert one channel's CHAI vector-payload rows to a coral::AttributeList per row, in row order, via toAttributeList().
| spec | - the CORAL specification every row is converted against |
| rows | - the CHAI rows to convert |
| std::invalid_argument | if a row is null, naming its index. |
| std::runtime_error | under the same conditions as toAttributeList(). |
Definition at line 191 of file ChaiCoralConverter.cxx.
|
static |
Convert a chai::Container to a CondAttrListCollection, one row per populated channel.
Named channels get their name added.
| container | - the container to convert |
| hasRunLumiBlockTime | - passed through to CondAttrListCollection's constructor |
| std::runtime_error | if a populated channel id exceeds CondAttrListCollection::ChanNum's range, or under the same conditions as toCoralSpec() or toAttributeList() for any channel's row. |
Definition at line 326 of file ChaiCoralConverter.cxx.
|
static |
Convert an AthenaAttributeList to a single-channel chai::Container.
| attrList | - the row to convert |
| channelId | - the channel id to assign the row to |
| channelName | - the channel name to assign |
| std::runtime_error | if attrList's specification has zero attributes, or under the same conditions as toFieldSpec() or toValues(). |
Definition at line 314 of file ChaiCoralConverter.cxx.
|
static |
Convert a CondAttrListCollection to a chai::Container, one channel per entry with an attribute list.
Named channels keep their name.
| collection | - the collection to convert |
| std::runtime_error | if the collection is empty, if its shared specification has zero attributes, or under the same conditions as toFieldSpec() or toValues() for any channel. |
Definition at line 348 of file ChaiCoralConverter.cxx.
|
static |
Build a coral::AttributeListSpecification from a CHAI FieldSpec, one attribute per field in field order.
See the type table above toCoralSpec()'s definition for the chai::Type <-> CORAL type mapping.
| fields | - the field specification to convert |
| std::runtime_error | on an unrecognised chai::Type. |
Definition at line 74 of file ChaiCoralConverter.cxx.
|
static |
Build a chai::FieldSpec from a coral::AttributeListSpecification, one field per attribute in spec order.
See the type table above toCoralSpec()'s definition for the chai::Type <-> CORAL type mapping.
| spec | - the CORAL specification to convert |
| std::runtime_error | if an attribute's CORAL type has no CHAI equivalent |
Definition at line 105 of file ChaiCoralConverter.cxx.
|
static |
Convert one coral::AttributeList to CHAI Values, one value per field in FieldSpec order.
Null attributes map to a null CHAI value. Fields are resolved by name, so an attribute list whose fields are ordered differently than the FieldSpec still maps correctly.
| fields | - the field specification the row shares with its siblings |
| attrList | - the CORAL row to convert |
| std::invalid_argument | if fields is null. |
| std::runtime_error | if the field counts of fields and attrList differ, if a field name in fields is not present in attrList, if a field's CORAL type doesn't match its chai::Type, or on an unrecognised CORAL type. |
Definition at line 205 of file ChaiCoralConverter.cxx.
|
static |
Convert a coral::AttributeList per row, in row order, to CHAI Values sharing one FieldSpecPtr, via toValues().
| fields | - the field specification every row is converted against |
| rows | - the CORAL rows to convert |
| std::invalid_argument | if fields is null. |
| std::runtime_error | under the same conditions as toValues(). |
Definition at line 290 of file ChaiCoralConverter.cxx.
|
static |
Total byte size of one channel's field values, using the same type mapping as toAttributeList().
Fixed-width for scalar types; the actual length for String/Blob. Null fields count as zero bytes.
Definition at line 370 of file ChaiCoralConverter.cxx.