ATLAS Offline Software
Loading...
Searching...
No Matches
ChaiCoralConverter.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
10
11#ifndef CORALUTILITIES_CHAICORALCONVERTER_H
12#define CORALUTILITIES_CHAICORALCONVERTER_H
13
16
17#include <chai/ContainerBase.h>
18
19#include <memory>
20#include <string>
21#include <vector>
22
23namespace coral {
24 class AttributeList;
25 class AttributeListSpecification;
26}
27
28namespace chai {
29 class Container;
30 class FieldSpec;
31 class VectorContainer;
32}
33
45public:
53 static coral::AttributeListSpecification* toCoralSpec(const chai::FieldSpec& fields);
54
62 static chai::FieldSpec toFieldSpec(const coral::AttributeListSpecification& spec);
63
75 static coral::AttributeList toAttributeList(const coral::AttributeListSpecification& spec,
76 const chai::Values& values);
77
85 static std::vector<coral::AttributeList> toAttributeListVec(const coral::AttributeListSpecification& spec,
86 const std::vector<chai::ValuesPtr>& rows);
87
100 static chai::ValuesPtr toValues(chai::FieldSpecPtr fields, const coral::AttributeList& attrList);
101
109 static std::vector<chai::ValuesPtr> toValuesVec(chai::FieldSpecPtr fields,
110 const std::vector<coral::AttributeList>& rows);
111
118 static std::unique_ptr<AthenaAttributeList> toAthenaAttributeList(const chai::Container& container);
119
128 static chai::Container toContainer(const AthenaAttributeList& attrList, uint64_t channelId = 0,
129 const std::string& channelName = "");
130
140 static std::unique_ptr<CondAttrListCollection> toCondAttrListCollection(const chai::Container& container,
141 bool hasRunLumiBlockTime);
142
150 static chai::Container toContainer(const CondAttrListCollection& collection);
151
155 static unsigned int valuesSize(const chai::Values& values);
156
158 static unsigned int payloadSize(const chai::Container& container);
159
162 static unsigned int payloadSize(const chai::VectorContainer& container);
163};
164
165#endif // CORALUTILITIES_CHAICORALCONVERTER_H
std::vector< std::vector< float > > VectorContainer
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
An AttributeList represents a logical row of attributes in a metadata table.
Converts between CHAI payload containers and CORAL objects: a specification plus per-channel rows,...
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 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 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,...
static coral::AttributeListSpecification * toCoralSpec(const chai::FieldSpec &fields)
Build a coral::AttributeListSpecification from a CHAI FieldSpec, one attribute per field in field ord...
static chai::FieldSpec toFieldSpec(const coral::AttributeListSpecification &spec)
Build a chai::FieldSpec from a coral::AttributeListSpecification, one field per attribute in spec ord...
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< AthenaAttributeList > toAthenaAttributeList(const chai::Container &container)
Convert a chai::Container's single populated channel to an AthenaAttributeList.
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::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,...
This class is a collection of AttributeLists where each one is associated with a channel number.
storage of the time histories of all the cells